From 46ceb9bfdcde71d1075d5a3c717e59a646dd607d Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期一, 12 五月 2025 07:54:21 +0800
Subject: [PATCH] bug
---
DevApp/Gs.DevApp/DevFrm/User/Role.cs | 63 +++++++++++++++++--------------
1 files changed, 35 insertions(+), 28 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/User/Role.cs b/DevApp/Gs.DevApp/DevFrm/User/Role.cs
index 425698c..ec3ff79 100644
--- a/DevApp/Gs.DevApp/DevFrm/User/Role.cs
+++ b/DevApp/Gs.DevApp/DevFrm/User/Role.cs
@@ -1,14 +1,14 @@
-锘縰sing System;
+锘縰sing DevExpress.XtraEditors;
+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.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
-using DevExpress.XtraEditors;
-using Gs.DevApp.Entity;
-using Gs.DevApp.ToolBox;
-using Gs.DevApp.UserControl;
-using Newtonsoft.Json;
namespace Gs.DevApp.DevFrm.User
{
@@ -26,26 +26,24 @@
toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1;
toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
- List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
- gvList.Add(gridView1);
- Gs.DevApp.ToolBox.UtilityHelper.getGridViewConfig(this.GetType().FullName, gvList);
+ 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)
{
- Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
+ _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
Task.Delay(100);
getPageList(1);
}
@@ -70,7 +68,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();
}
@@ -177,11 +175,11 @@
Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
if (xtraTabControl1.SelectedTabPageIndex == 1)
{
- getModel(lbGuid.Text.Trim());
+ getModel(rowGuid);
}
else
{
- UtilityHelper.ChangeEnableByControl(panel1.Controls, true);
+ UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true);
}
}
@@ -194,7 +192,7 @@
{
lbGuid.Text = "";
Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4);
- UtilityHelper.CleanValueByControl(panel1.Controls, true);
+ UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true);
}
/// <summary>
@@ -218,7 +216,6 @@
txt_roleRemark.Focus();
return;
}
-
var _obj = new
{
guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()),
@@ -236,7 +233,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)
@@ -251,7 +250,7 @@
/// <param name="pageSize">姣忛〉鍑犳潯</param>
private void getPageList(int curPage)
{
- var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
+ gcMain1.DataSource = null;var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
var pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "ROLE_NAME asc,CREATE_TIME ", "desc", "", _sbSqlWhere.ToString());
var json = JsonConvert.SerializeObject(pgq);
try
@@ -262,16 +261,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();
- gridView1.BestFitColumns();
+ 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;//褰撳墠椤�
@@ -287,7 +286,10 @@
MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
}
-
+ /// <summary>
+ /// 璇诲彇瀹炰綋
+ /// </summary>
+ /// <param name="strGuid"></param>
private void getModel(string strGuid)
{
bool isEdit = false;
@@ -312,7 +314,7 @@
{
var dy = _rtn.rtnData;
lbGuid.Text = strGuid;
- UtilityHelper.SetValueByObj(panel1.Controls, dy, isEdit);
+ UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit);
}
else
{
@@ -335,14 +337,19 @@
if (node.Nodes.Count > 0) TraverseTreeViewNodes(node.Nodes);
}
}
+ /// <summary>
+ /// 寮瑰嚭閰嶇疆鏉冮檺
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.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);
+ var roleGuid = dr["guid"].ToString();
+ var frm = new RoleSelectAction(roleGuid,"璁剧疆瑙掕壊鏉冮檺");
frm.ShowDialog();
}
}
--
Gitblit v1.9.3