From c17dd77e798b3b94da8ee93ba3577d0bd540a125 Mon Sep 17 00:00:00 2001
From: duheng <2784771470@qq.com>
Date: 星期一, 26 八月 2024 09:37:30 +0800
Subject: [PATCH] 优化界面

---
 WinFrmUI/HStation.WinFrmUI.Basic/01-SysCatalogManage/SysCatalogManageMainPanel.cs |   27 ++++++++++++++++++---------
 1 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/WinFrmUI/HStation.WinFrmUI.Basic/01-SysCatalogManage/SysCatalogManageMainPanel.cs b/WinFrmUI/HStation.WinFrmUI.Basic/01-SysCatalogManage/SysCatalogManageMainPanel.cs
index 37fe522..97a304f 100644
--- a/WinFrmUI/HStation.WinFrmUI.Basic/01-SysCatalogManage/SysCatalogManageMainPanel.cs
+++ b/WinFrmUI/HStation.WinFrmUI.Basic/01-SysCatalogManage/SysCatalogManageMainPanel.cs
@@ -6,7 +6,7 @@
         {
             InitializeComponent();
             this.PageTitle.Caption = "鍒嗙被绠$悊";
-            this.PageTitle.HeaderSvgImage = this.svgImage32[1];
+            this.PageTitle.HeaderSvgImage = this.svgImage32[0];
             this.PageTitle.SvgImageSize = new Size(24, 24);
             this.typeTreeListCtrl2.FocusedChangedEvent += TypeTreeListCtrl2_FocusedChangedEvent;
         }
@@ -41,6 +41,8 @@
         {
             var dlg = new AddSysCatalogDlg();
             var typeID = this.typeTreeListCtrl2.GetCurrentID();
+            if (typeID == 0)
+                return;
             dlg.SetBindingData(typeID);
             dlg.ReloadDataEvent += async (rhs) =>
            {
@@ -119,17 +121,24 @@
             }
             if (MessageBoxHelper.IsClickOk($"纭鍒犻櫎鏁版嵁琛�?", "鎻愮ず"))
                 return;
-            var result = await _bll.DeleteByID(currentVm.ID);
-            if (result)
+            try
             {
-                _allBindingList.Remove(currentVm);
-                this.catlogViewModelBindingSource.ResetBindings(false);
-                MessageBoxHelper.ShowSuccess($"鍒犻櫎鎴愬姛!");
+                var result = await _bll.DeleteByID(currentVm.ID);
+                if (result)
+                {
+                    _allBindingList.Remove(currentVm);
+                    this.catlogViewModelBindingSource.ResetBindings(false);
+                    MessageBoxHelper.ShowSuccess($"鍒犻櫎鎴愬姛!");
+                }
+                else
+                {
+                    MessageBoxHelper.ShowError($"鍒犻櫎澶辫触!");
+                    return;
+                }
             }
-            else
+            catch (Yw.Dto.InternalException ex)
             {
-                MessageBoxHelper.ShowError($"鍒犻櫎澶辫触!");
-                return;
+                MessageBoxHelper.ShowError(ex.ErrorMsg);
             }
         }
 

--
Gitblit v1.9.3