From 7507591ef45cfa8f1080f6dbf68b411edcc7f086 Mon Sep 17 00:00:00 2001
From: lixiaojun <1287241240@qq.com>
Date: 星期日, 03 十一月 2024 15:42:56 +0800
Subject: [PATCH] 水力存储优化

---
 WinFrmUI/HStation.WinFrmUI.Basic/02-SysPropManage/SysPropManageMainPanel.cs |   50 ++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 48 insertions(+), 2 deletions(-)

diff --git a/WinFrmUI/HStation.WinFrmUI.Basic/02-SysPropManage/SysPropManageMainPanel.cs b/WinFrmUI/HStation.WinFrmUI.Basic/02-SysPropManage/SysPropManageMainPanel.cs
index 2f6ede7..461b820 100644
--- a/WinFrmUI/HStation.WinFrmUI.Basic/02-SysPropManage/SysPropManageMainPanel.cs
+++ b/WinFrmUI/HStation.WinFrmUI.Basic/02-SysPropManage/SysPropManageMainPanel.cs
@@ -1,4 +1,8 @@
-锘縩amespace HStation.WinFrmUI.Basic
+锘縰sing DevExpress.Utils.Behaviors;
+using DevExpress.Utils.DragDrop;
+using DevExpress.XtraTreeList;
+
+namespace HStation.WinFrmUI.Basic
 {
     public partial class SysPropManageMainPanel : DocumentPage
     {
@@ -7,6 +11,9 @@
             InitializeComponent();
             this.gridView1.SetNormalView();
             this.gridView1.RegistCustomDrawRowIndicator();
+            this.PageTitle.Caption = "灞炴�х鐞�";
+            this.PageTitle.HeaderSvgImage = this.svgImage32[0];
+            this.PageTitle.SvgImageSize = new Size(24, 24);
             this.propGroupTreeListCtrl1.FocusedChangedEvent += ModuleTreeListCtrl1_FocusedChangedEvent;
         }
 
@@ -111,7 +118,7 @@
                 return;
             }
         }
- 
+
         //灞炴�ч�夐」
         private void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
         {
@@ -127,5 +134,44 @@
                 dlg.ShowDialog();
             }
         }
+
+        //鎺掑簭
+        private void barCheckItemSorter_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
+        {
+            if (barCheckSorter.Checked)
+            {
+                behaviorManager1.Attach<DragDropBehavior>(gridView1, behavior =>
+                {
+                    //        behavior.BeginDragDrop += Behavior_BeginDragDrop;
+                    behavior.EndDragDrop += Behavior_EndDragDrop;
+                });
+            }
+            else
+            {
+                behaviorManager1.Detach<DragDropBehavior>(gridView1);
+            }
+        }
+
+        private async void Behavior_EndDragDrop(object sender, EndDragDropEventArgs e)
+        {
+            var vm = this.gridView1.GetCurrentViewModel(_allBindingList);
+            var sorterList = new List<Yw.Vmo.Sorter>();
+            int i = 1;
+            foreach (var item in _allBindingList)
+            {
+                sorterList.Add(new Yw.Vmo.Sorter() { ID = item.ID, SortCode = i });
+                i++;
+            }
+            if (await _bll.UpdateSorter(sorterList))
+            {
+                this.propViewModelBindingSource.ResetBindings(false);
+            }
+            else
+            {
+                //     gridView1.FocusedRowHandle = _LastRowIndex;
+                TipFormHelper.ShowError("淇敼鎺掑簭澶辫触!");
+                return;
+            }
+        }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3