From b084bd77d01a94c8f0a2d20c86a1f45ba7c8a23c Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期六, 19 四月 2025 14:08:05 +0800
Subject: [PATCH] 页面跳转

---
 DevApp/Gs.DevApp/DevFrm/User/User.cs |  126 +++++++++++++++++++++++++++++------------
 1 files changed, 88 insertions(+), 38 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/User/User.cs b/DevApp/Gs.DevApp/DevFrm/User/User.cs
index ec78126..ea25670 100644
--- a/DevApp/Gs.DevApp/DevFrm/User/User.cs
+++ b/DevApp/Gs.DevApp/DevFrm/User/User.cs
@@ -1,14 +1,14 @@
-锘縰sing System;
-using System.Collections.Generic;
-using System.Data;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-using DevExpress.XtraEditors;
+锘縰sing DevExpress.XtraEditors;
 using DevExpress.XtraEditors.Controls;
 using Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
 using Gs.DevApp.UserControl;
 using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Threading.Tasks;
+using System.Windows.Forms;
 
 namespace Gs.DevApp.DevFrm.User
 {
@@ -25,27 +25,28 @@
             toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1;
             toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
             toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
+            this.toolBarMenu1.getXmlConfig();
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, null, "", "", (value) =>
             {
                 Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
-            });
+            }, tips);
             Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
             {
                 getModel(value);
             }, (value) =>
             {
                 getPageList(this.pageBar1.CurrentPage);
-            });
+            }, lbGuid);
             getPageList(1);
             pageBar1.PagerEvent += PageBar1_PagerEvent;
         }
-        private   void GridView1_ColumnFilterChanged(object sender, EventArgs e)
+        private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
         {
-            Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
-           Task.Delay(100);
+            _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
+            Task.Delay(100);
             getPageList(1);
         }
-      
+
         /// <summary>
         ///     鍒嗛〉浜嬩欢
         /// </summary>
@@ -66,7 +67,7 @@
             gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
             gridView1.ActiveFilter.Clear();
             gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
-            var frm = new ShowFilter(gridView1.Columns, _filterList);
+            var frm = new ShowFilter(gridView1.Columns, _filterList, this.GetType().FullName);
             frm.UpdateParent += Frm_UpdateParent;
             frm.ShowDialog();
         }
@@ -121,9 +122,10 @@
                 if (_rtn.rtnCode > 0)
                 {
                     if (xtraTabControl1.SelectedTabPageIndex == 0)
-                        getPageList(this.pageBar1.CurrentPage);
+                    { }
                     else
                         Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2);
+                    getPageList(this.pageBar1.CurrentPage);
                 }
 
                 MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
@@ -163,16 +165,22 @@
         /// <param name="e"></param>
         private void ToolBarMenu1_btnEdtClick(object sender, EventArgs e)
         {
-            string rowGuid, rowName;
-            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
-                lbGuid, txt_userName, gridView1);
+            string rowGuid = "", rowName = "";
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_userName, gridView1);
             if (string.IsNullOrEmpty(rowGuid))
             {
-                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
             Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
-            UtilityHelper.ChangeEnableByControl(panel1.Controls, true);
+            if (xtraTabControl1.SelectedTabPageIndex == 1)
+            {
+                getModel(rowGuid);
+            }
+            else
+            {
+                UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true);
+            }
         }
 
         /// <summary>
@@ -184,8 +192,8 @@
         {
             lbGuid.Text = "";
             Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4);
-            UtilityHelper.CleanValueByControl(panel1.Controls, true);
-            txt_password.Visible = lbPwd.Visible = true;
+            UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true);
+            txt_password.Enabled = true;
             txt_account.Enabled = txt_password.Enabled = true;
         }
 
@@ -220,7 +228,7 @@
 
             var _obj = new
             {
-                guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
+                Guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
                 account = txt_account.Text.Trim(),
                 password = txt_password.Text.Trim(),
                 userName = txt_userName.Text.Trim(),
@@ -229,7 +237,8 @@
                 email = txt_email.Text.Trim(),
                 isStatus = txt_isStatus.Checked,
                 remark = txt_remark.Text.Trim(),
-                isSys = 0
+                isSys = 0,
+                staffId = txt_staffId.GetId()
             };
             try
             {
@@ -241,7 +250,9 @@
                 {
                     lbGuid.Text = _rtn.rtnData;
                     toolBarMenu1.isSetBtn = true;
-                    UtilityHelper.ChangeEnableByControl(panel1.Controls, false);
+                    UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false);
+                    toolBarMenu1.currentAction = "";
+                    Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6);
                 }
             }
             catch (Exception ex)
@@ -254,11 +265,11 @@
         /// </summary>
         /// <param name="curPage">绗嚑椤�</param>
         /// <param name="pageSize">姣忛〉鍑犳潯</param>
-        private   void getPageList(int curPage)
+        private void getPageList(int curPage)
         {
             var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
-            var pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "CREATE_TIME",
-                "asc", "", _sbSqlWhere.ToString());
+            var pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "a.ACCOUNT asc ,a.CREATE_TIME",
+                "desc", "", _sbSqlWhere.ToString());
             var json = JsonConvert.SerializeObject(pgq);
             try
             {
@@ -268,15 +279,16 @@
                 if (dd.rtnCode > 0)
                 {
                     DataTable dt = dd.rtnData.list;
-                    gcMain.BindingContext = new BindingContext();
+                    gcMain1.BindingContext = new BindingContext();
                     gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
                     if (dt.Rows.Count > 0)
                     {
-                        gcMain.DataSource = dt;
-                        gcMain.ForceInitialize();
+                        gcMain1.DataSource = dt;
+                        gcMain1.ForceInitialize();
+                        gridView1.BestFitColumns(); Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gridView1);
                     }
                     else
-                        UtilityHelper.SetDefaultTable(gcMain, gridView1);
+                        UtilityHelper.SetDefaultTable(gcMain1, gridView1);
                     gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
                     pageBar1.TotalPages = dd.rtnData.pages;//鎬婚〉
                     pageBar1.CurrentPage = curPage;//褰撳墠椤�
@@ -291,7 +303,6 @@
             {
                 MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
-            
         }
 
         private void getModel(string strGuid)
@@ -317,10 +328,8 @@
                 {
                     var dy = _rtn.rtnData;
                     lbGuid.Text = strGuid;
-                    UtilityHelper.SetValueByObj(panel1.Controls, dy, isEdit);
-                    txt_account.Enabled = txt_password.Enabled =
-                        txt_password.Visible =
-                            lbPwd.Visible = tipPwd.Visible = false;
+                    UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit);
+                    txt_account.Enabled = txt_password.Enabled = txt_password.Enabled = false;
                 }
                 else
                 {
@@ -332,7 +341,11 @@
                 MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
         }
-
+        /// <summary>
+        /// 瑙掕壊
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
         private void repositoryItemButtonEdit1_ButtonClick(object sender,
             ButtonPressedEventArgs e)
         {
@@ -345,7 +358,11 @@
                 frm.ShowDialog();
             }
         }
-
+        /// <summary>
+        /// 瀵嗙爜
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
         private void repositoryItemButtonEdit2_ButtonClick(object sender,
             ButtonPressedEventArgs e)
         {
@@ -358,5 +375,38 @@
                 frm.ShowDialog();
             }
         }
+        /// <summary>
+        /// 涓汉鏉冮檺
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void repositoryItemButtonEdit3_ButtonClick(object sender, ButtonPressedEventArgs e)
+        {
+            if (e.Button.Index == 0)
+            {
+                var rowhandle = gridView1.FocusedRowHandle;
+                var dr = gridView1.GetDataRow(rowhandle);
+                var userGuid = dr["guid"].ToString();
+                var frm = new RoleSelectAction(userGuid);
+                frm.ShowDialog();
+            }
+        }
+
+        /// <summary>
+        /// 鏉冮檺闆嗗悎
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void repositoryItemButtonEdit4_ButtonClick(object sender, ButtonPressedEventArgs e)
+        {
+            if (e.Button.Index == 0)
+            {
+                var rowhandle = gridView1.FocusedRowHandle;
+                var dr = gridView1.GetDataRow(rowhandle);
+                var userGuid = dr["guid"].ToString();
+                var frm = new ViewRole(userGuid);
+                frm.ShowDialog();
+            }
+        }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3