From 5aba1bf12cd27faa797e7f3d15e0f960bdc2a4b2 Mon Sep 17 00:00:00 2001
From: duheng <2784771470@qq.com>
Date: 星期五, 05 七月 2024 16:57:09 +0800
Subject: [PATCH] 优化界面

---
 WinFrmUI/HStation.WinFrmUI.Xhs.Project/05-CatlogManage/TypeTreeListCtrl.cs |   38 +++++++++++++++++++++++++++-----------
 1 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Project/05-CatlogManage/TypeTreeListCtrl.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Project/05-CatlogManage/TypeTreeListCtrl.cs
index 3ea6958..05a266d 100644
--- a/WinFrmUI/HStation.WinFrmUI.Xhs.Project/05-CatlogManage/TypeTreeListCtrl.cs
+++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Project/05-CatlogManage/TypeTreeListCtrl.cs
@@ -1,6 +1,8 @@
-锘縰sing DevExpress.XtraEditors;
+锘縰sing DevExpress.XtraBars.Docking2010.DragEngine;
+using DevExpress.XtraEditors;
 using HStation.WinFrmUI.Xhs.Project;
 using ISupply.WinFrmUI;
+using Yw.Basic;
 
 namespace HStation.WinFrmUI.Xhs
 {
@@ -12,6 +14,7 @@
         public TypeTreeListCtrl()
         {
             InitializeComponent();
+            this.treeList1.InitialDefaultSettings();
         }
 
         /// <summary>
@@ -19,9 +22,11 @@
         /// </summary>
         public event Action<long> FocusedChangedEvent;
 
-        private List<TypeViewModel> _allBindingList = null;
+        private List<TypeTreeListViewModel> _allBindingList = null;
 
-        private Yw.BLL.SysModule _bll = null;
+        private Yw.BLL.SysTypeStd _bll = null;
+
+        private Yw.BLL.SysModule _Modulebll = null;
 
         /// <summary>
         /// 缁戝畾鏁版嵁
@@ -36,8 +41,19 @@
         /// </summary>
         public async void SetBindingData()
         {
-            _allBindingList = new List<TypeViewModel>();
-
+            _allBindingList = new List<TypeTreeListViewModel>();
+            _bll = new Yw.BLL.SysTypeStd();
+            var alllist = await _bll.GetLogicalTreeListByExtendType(eExtendType.Catalog);
+            foreach (var item in alllist)
+            {
+                var module = new TypeTreeListViewModel(item);
+                _allBindingList.Add(module);
+                foreach (var child in item.Children)
+                {
+                    var children = new TypeTreeListViewModel(child);
+                    _allBindingList.Add(children);
+                }
+            }
             this.moduleViewModelBindingSource.DataSource = _allBindingList;
             this.moduleViewModelBindingSource.ResetBindings(false);
         }
@@ -85,11 +101,11 @@
             var dlg = new AddMoudleDlg();
             dlg.ReloadDataEvent += async (rhs) =>
             {
-                var id = await _bll.Insert(rhs);
+                var id = await _Modulebll.Insert(rhs);
                 if (id > 0)
                 {
-                    var model = await _bll.GetByID(id);
-                    //   _allBindingList.Add(new ModuleViewModel(model));
+                    var model = await _Modulebll.GetByID(id);
+                    //  _allBindingList.Add(new ModuleViewModel(model));
                     this.moduleViewModelBindingSource.ResetBindings(false);
                     return true;
                 }
@@ -118,7 +134,7 @@
             dlg.SetBindingData(vm.ID);
             dlg.ReloadDataEvent += async (rhs) =>
             {
-                if (await _bll.Update(rhs))
+                if (await _Modulebll.Update(rhs))
                 {
                     //vm.Reset(rhs);
                     this.moduleViewModelBindingSource.ResetBindings(false);
@@ -140,12 +156,12 @@
             }
             if (MessageBoxHelper.IsClickOk("纭鍒犻櫎鏁版嵁琛�?", "鎻愮ず"))
                 return;
-            if (await _bll.IsExistByModuleID(currentVm.ID))
+            if (await _Modulebll.IsExistByModuleID(currentVm.ID))
             {
                 MessageBoxHelper.ShowWarning("瀛樺湪绯荤粺绫诲瀷,涓嶅彲鍒犻櫎!");
                 return;
             }
-            var result = await _bll.DeleteByID(currentVm.ID);
+            var result = await _Modulebll.DeleteByID(currentVm.ID);
             if (result)
             {
                 _allBindingList.Remove(currentVm);

--
Gitblit v1.9.3