Files
29WxOrder/29WxOrder/OrderForms/TransitAddressForm.cs
T
2026-06-12 10:41:13 +08:00

62 lines
1.8 KiB
C#

using NaiBa.Util.Helper;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Work.BaseForms;
namespace _29WxOrder.OrderForms
{
public partial class TransitAddressForm : BaseGeneralForm
{
public TransitAddressForm()
{
InitializeComponent();
}
private void pnlClear_Click(object sender, EventArgs e)
{
this.txtName.Text = this.txtMobile.Text = this.txtAddress.Text = "";
}
private void pnlSave_Click(object sender, EventArgs e)
{
TransitAddress = new TransitAddressInfo()
{
Name = txtName.Text,
Address = txtAddress.Text,
Mobile = txtMobile.Text,
};
if (string.IsNullOrWhiteSpace(TransitAddress.Name) || string.IsNullOrWhiteSpace(TransitAddress.Name) || string.IsNullOrWhiteSpace(TransitAddress.Name))
TransitAddress = null;
ConfigHelper.SaveConfig("transit_address", TransitAddress);
BaseMsgForm.ShowInfo("保存成功!");
this.Close();
}
public static TransitAddressInfo TransitAddress = null;
private void TransitAddressFrom_Load(object sender, EventArgs e)
{
if (TransitAddress != null)
{
txtName.Text = TransitAddress.Name;
txtMobile.Text = TransitAddress.Mobile;
txtAddress.Text = TransitAddress.Address;
}
}
}
public class TransitAddressInfo
{
public string Name { get; set; }
public string Mobile { get; set; }
public string Address { get; set; }
}
}