duheng
2024-11-27 2e3201e1be4247b47b2b8c2a60c56c0d6885b05a
WinFrmUI/HStation.WinFrmUI.Assets.Core/04-pipe/01-series/AddPipeLineSeriesDlg.cs
@@ -6,9 +6,27 @@
        {
            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();
            if (allList != null)
            {
                foreach (var item in allList)
                {
                    _assetsPipeSeriesViews.Add(new AssetsPipeSeriesViewModel(item));
                }
            }
            treeListLookUpEdit1TreeList.DataSource = _assetsPipeSeriesViews;
        }
        //数据验证
        private bool Valid()
@@ -31,7 +49,7 @@
            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("添加成功!");
            }