From eaff2518ab6159c360ec2a865b45002b26fdc4cd Mon Sep 17 00:00:00 2001
From: duheng <2784771470@qq.com>
Date: 星期一, 19 八月 2024 14:25:47 +0800
Subject: [PATCH] 增加资产删除方法报错提醒

---
 WinFrmUI/HStation.WinFrmUI.Basic/00-SysTypeManage/SysTypeManageMainPanel.cs |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/WinFrmUI/HStation.WinFrmUI.Basic/00-SysTypeManage/SysTypeManageMainPanel.cs b/WinFrmUI/HStation.WinFrmUI.Basic/00-SysTypeManage/SysTypeManageMainPanel.cs
index c540c33..653720f 100644
--- a/WinFrmUI/HStation.WinFrmUI.Basic/00-SysTypeManage/SysTypeManageMainPanel.cs
+++ b/WinFrmUI/HStation.WinFrmUI.Basic/00-SysTypeManage/SysTypeManageMainPanel.cs
@@ -100,16 +100,24 @@
             }
             if (MessageBoxHelper.IsClickOk($"纭鍒犻櫎鏁版嵁琛�?", "鎻愮ず"))
                 return;
-            var result = await _bll.DeleteByID(currentVm.ID);
-            if (result)
+            try
             {
-                _allBindingList.Remove(currentVm);
-                this.typeViewModelBindingSource.ResetBindings(false);
-                MessageBoxHelper.ShowSuccess($"鍒犻櫎鎴愬姛!");
+                var result = await _bll.DeleteByID(currentVm.ID);
+                if (result)
+                {
+                    _allBindingList.Remove(currentVm);
+                    this.typeViewModelBindingSource.ResetBindings(false);
+                    MessageBoxHelper.ShowSuccess($"鍒犻櫎鎴愬姛!");
+                }
+                else
+                {
+                    MessageBoxHelper.ShowError($"鍒犻櫎澶辫触!");
+                    return;
+                }
             }
-            else
+            catch (Yw.Dto.InternalException ex)
             {
-                MessageBoxHelper.ShowError($"鍒犻櫎澶辫触!");
+                MessageBoxHelper.ShowError(ex.ErrorMsg);
                 return;
             }
         }

--
Gitblit v1.9.3