From 77a4be9a061af13fcd7a0143cf6299172a6fa7f9 Mon Sep 17 00:00:00 2001
From: lixiaojun <1287241240@qq.com>
Date: 星期四, 05 十二月 2024 11:14:46 +0800
Subject: [PATCH] 项目管理优化

---
 WinFrmUI/HStation.WinFrmUI.Assets.Core/10-exchanger/01-series/ExchangerTreeListCtrl.cs |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/WinFrmUI/HStation.WinFrmUI.Assets.Core/10-exchanger/01-series/ExchangerTreeListCtrl.cs b/WinFrmUI/HStation.WinFrmUI.Assets.Core/10-exchanger/01-series/ExchangerTreeListCtrl.cs
index f8936b8..42d0cd1 100644
--- a/WinFrmUI/HStation.WinFrmUI.Assets.Core/10-exchanger/01-series/ExchangerTreeListCtrl.cs
+++ b/WinFrmUI/HStation.WinFrmUI.Assets.Core/10-exchanger/01-series/ExchangerTreeListCtrl.cs
@@ -1,5 +1,6 @@
 锘縰sing DevExpress.XtraEditors;
 using Yw;
+using Yw.Untity;
 
 namespace HStation.WinFrmUI.Assets
 {
@@ -50,8 +51,13 @@
         private void BtnAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
         {
             var dlg = new AddAssetsExchangerSeriesDlg();
-            dlg.ReloadDataEvent += async (rhs) =>
+            dlg.ReloadDataEvent += async (rhs, currentId) =>
             {
+                if (currentId != null)
+                {
+                    var select = await _bll.GetByID(Convert.ToInt64(currentId));
+                    rhs.ParentIds = TreeParentIdsHelper.GetChildParentIds(select.ID, select.ParentIds);
+                }
                 var bll = new BLL.AssetsExchangerSeries();
                 var id = await bll.Insert(rhs);
                 if (id > 0)
@@ -72,7 +78,7 @@
             var vm = this.treeList1.GetCurrentViewModel(_allBindingList);
             if (vm == null)
             {
-                MessageBoxHelper.ShowWarning("璇烽�夋嫨鏁版嵁琛�!");
+                // MessageBoxHelper.ShowWarning("璇烽�夋嫨鏁版嵁琛�!");
                 return;
             }
             ReloadEvent.Invoke(vm.ID);
@@ -92,8 +98,13 @@
             if (AssetsExchangerSeries == null)
                 return;
             dlg.SetBindingData(AssetsExchangerSeries);
-            dlg.ReloadDataEvent += async (rhs) =>
+            dlg.ReloadDataEvent += async (rhs, currentId) =>
             {
+                if (currentId != null)
+                {
+                    var select = await _bll.GetByID(Convert.ToInt64(currentId));
+                    rhs.ParentIds = TreeParentIdsHelper.GetChildParentIds(select.ID, select.ParentIds);
+                }
                 if (await BLLFactory<BLL.AssetsExchangerSeries>.Instance.Update(rhs))
                 {
                     vm.Reset(rhs);

--
Gitblit v1.9.3