| | |
| | | InitializeComponent(); |
| | | } |
| | | |
| | | public event Func<Vmo.Xhs.XhsProjectExtensions, bool> ReloadEvent; |
| | | public event Func<Vmo.Xhs.XhsProjectExtensions, Task<bool>> ReloadDataEvent; |
| | | |
| | | //数据验证 |
| | | private bool Valid() |
| | | { |
| | | return false; |
| | | return true; |
| | | } |
| | | |
| | | //确定 |
| | |
| | | { |
| | | if (!Valid()) |
| | | return; |
| | | var bll = new BLL.XhsProjectExtensions(); |
| | | var model = new Vmo.Xhs.XhsProjectExtensions(); |
| | | model.Address = this.TextAdress.Text.Trim(); |
| | | model.Customer = this.TextCustomerName.Text.Trim(); |
| | | model.Description = this.TextDescription.Text.Trim(); |
| | | model.Name = this.TextProjectName.Text.Trim(); |
| | | model.TagName = this.TextTagName.Text.Trim(); |
| | | model.SiteList = new List<Vmo.Xhs.XhsProjectSite> |
| | | { |
| | | new Vmo.Xhs.XhsProjectSite |
| | | { |
| | | Name=this.TextProjectName.Text, |
| | | Description=this.TextDescription.Text, |
| | | } |
| | | }; |
| | | if (await this.ReloadDataEvent.Invoke(model)) |
| | | { |
| | | MessageBoxHelper.ShowSuccess("添加成功!"); |
| | | } |
| | | else |
| | | { |
| | | MessageBoxHelper.ShowError("添加失败!"); |
| | | } |
| | | this.DialogResult = DialogResult.OK; |
| | | this.Close(); |
| | | } |
| | | } |
| | | } |