using ISupply.Model; namespace ISupply.WinFrm.Main._UserControls { public partial class ShopWizardForm : DevExpress.XtraEditors.XtraUserControl { public ShopWizardForm() { InitializeComponent(); } public ShopFormModel GetData() { var m = new ShopFormModel() { Address = txtAddress.Text, Area = 1721426218814935040, City = 1721435432132153344, Dist = 1721435432132153344, Name = txtName.Text, AreaSquare = string.IsNullOrEmpty(txtAreaSquare.Text) ? decimal.Zero : decimal.Parse(txtAreaSquare.Text), BusinessType = cbBusinessType.Text, Floor = string.IsNullOrEmpty(txtFloor.Text) ? 0 : int.Parse(txtFloor.Text), Nature = cbNature.Text, PropertyCompany = txtPropertyCompany.Text, PropertyRight = string.IsNullOrEmpty(txtPropertyRight.Text) ? 0 : int.Parse(txtPropertyRight.Text), }; return m; } public void SetData(ShopFormModel model) { if (model == null) return; txtAddress.Text = model.Address; txtName.Text = model.Name.ToString(); cbArea.Text = "上海市"; cbCity.Text = "上海市"; cbDist.Text = "闵行区"; txtAreaSquare.Text = model.AreaSquare.ToString(); cbBusinessType.Text = model.BusinessType.ToString(); txtFloor.Text = model.Floor.ToString(); cbNature.Text = model.Nature.ToString(); txtPropertyCompany.Text = model.PropertyCompany.ToString(); txtPropertyRight.Text = model.PropertyRight.ToString(); } } }