| | |
| | | { |
| | | InitializeComponent(); |
| | | this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon; |
| | | this.Load += AddAssetsPipeSeriesDlg_Load; |
| | | } |
| | | |
| | | public event Func<Vmo.AssetsPipeSeriesVmo, Task<bool>> ReloadDataEvent = null; |
| | | public event Func<Vmo.AssetsPipeSeriesVmo, object, Task<bool>> ReloadDataEvent = null; |
| | | |
| | | private List<AssetsPipeSeriesViewModel> _assetsPipeSeriesViews; |
| | | |
| | | //初始化 |
| | | private async void AddAssetsPipeSeriesDlg_Load(object sender, EventArgs e) |
| | | { |
| | | _assetsPipeSeriesViews = new List<AssetsPipeSeriesViewModel>(); |
| | | var allList = await new BLL.AssetsPipeSeries().GetAll(); |
| | | foreach (var item in allList) |
| | | { |
| | | _assetsPipeSeriesViews.Add(new AssetsPipeSeriesViewModel(item)); |
| | | } |
| | | treeListLookUpEdit1TreeList.DataSource = _assetsPipeSeriesViews; |
| | | } |
| | | |
| | | //数据验证 |
| | | private bool Valid() |
| | |
| | | model.Name = NameTextEdit.Text; |
| | | model.TagName = TagNameTextEdit.Text; |
| | | model.Description = DescriptionTextEdit.Text; |
| | | if (await this.ReloadDataEvent.Invoke(model)) |
| | | if (await this.ReloadDataEvent.Invoke(model, this.textEditParentList.EditValue)) |
| | | { |
| | | TipFormHelper.ShowSucceed("添加成功!"); |
| | | } |