From 65dad8dd6bd3074dc3267332c813deace2e59c36 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期五, 21 三月 2025 08:46:36 +0800
Subject: [PATCH] 异常报告
---
DevApp/Gs.DevApp/DevFrm/User/User.cs | 133 +++++++++++++++++++++++++++++---------------
1 files changed, 88 insertions(+), 45 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/User/User.cs b/DevApp/Gs.DevApp/DevFrm/User/User.cs
index 1279dbd..43bf697 100644
--- a/DevApp/Gs.DevApp/DevFrm/User/User.cs
+++ b/DevApp/Gs.DevApp/DevFrm/User/User.cs
@@ -1,8 +1,6 @@
锘縰sing System;
using System.Collections.Generic;
using System.Data;
-using System.Drawing;
-using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
@@ -27,28 +25,28 @@
toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1;
toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
- gcMain.MouseDoubleClick += GcMain_MouseDoubleClick;
+ 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);
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, null, "", "", (value) =>
+ {
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
+ });
+ Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
+ {
+ getModel(value);
+ }, (value) =>
+ {
+ getPageList(this.pageBar1.CurrentPage);
+ });
getPageList(1);
- Gs.DevApp.ToolBox.UtilityHelper.SetGridSear(gridView1);
pageBar1.PagerEvent += PageBar1_PagerEvent;
}
- private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
+ private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
{
- _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns);
- Task.Delay(100);
+ Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
+ Task.Delay(100);
getPageList(1);
- }
- /// <summary>
- /// 鍙屽嚮浜嬩欢
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void GcMain_MouseDoubleClick(object sender, MouseEventArgs e)
- {
- var rowGuid =
- UtilityHelper.GetCurrentDoubleRow(gridView1, e, "guid");
- if (!string.IsNullOrEmpty(rowGuid))
- getModel(rowGuid, false, 999);
}
/// <summary>
@@ -94,7 +92,7 @@
/// <param name="e"></param>
private void ToolBarMenu1_btnEscClick(object sender, EventArgs e)
{
- UtilityHelper.JumpToTab(xtraTabControl1, 0);
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 1);
}
/// <summary>
@@ -106,7 +104,7 @@
{
string rowGuid, rowName;
(rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
- lbGuid, txt_userName, gridView1);
+ lbGuid, txt_userName, gridView1, "userName");
if (string.IsNullOrEmpty(rowGuid))
{
MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
@@ -125,8 +123,11 @@
var _rtn = UtilityHelper.ReturnToDynamic(strJson);
if (_rtn.rtnCode > 0)
{
- UtilityHelper.JumpToTab(xtraTabControl1, 0);
- getPageList(1);
+ if (xtraTabControl1.SelectedTabPageIndex == 0)
+ { }
+ else
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2);
+ getPageList(this.pageBar1.CurrentPage);
}
MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
@@ -145,7 +146,7 @@
private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e)
{
if (xtraTabControl1.SelectedTabPageIndex == 1)
- getModel(lbGuid.Text.Trim(), false, 999);
+ getModel(lbGuid.Text.Trim());
else
{
_filterList.Clear();
@@ -174,8 +175,8 @@
MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
-
- getModel(rowGuid, true, 1);
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
+ UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true);
}
/// <summary>
@@ -185,10 +186,10 @@
/// <param name="e"></param>
private void ToolBarMenu1_btnAddClick(object sender, EventArgs e)
{
- UtilityHelper.JumpToTab(xtraTabControl1, 1);
lbGuid.Text = "";
- UtilityHelper.CleanValueByControl(panel1.Controls, true);
- txt_password.Visible = lbPwd.Visible = true;
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4);
+ UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true);
+ txt_password.Enabled =true;
txt_account.Enabled = txt_password.Enabled = true;
}
@@ -223,7 +224,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(),
@@ -232,7 +233,8 @@
email = txt_email.Text.Trim(),
isStatus = txt_isStatus.Checked,
remark = txt_remark.Text.Trim(),
- isSys = 0
+ isSys = 0,
+ staffId = txt_staffId.GetId()
};
try
{
@@ -244,7 +246,7 @@
{
lbGuid.Text = _rtn.rtnData;
toolBarMenu1.isSetBtn = true;
- UtilityHelper.ChangeEnableByControl(panel1.Controls, false);
+ UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false);
}
}
catch (Exception ex)
@@ -257,12 +259,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
{
@@ -278,6 +279,7 @@
{
gcMain.DataSource = dt;
gcMain.ForceInitialize();
+ gridView1.BestFitColumns(); Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gridView1);
}
else
UtilityHelper.SetDefaultTable(gcMain, gridView1);
@@ -295,17 +297,19 @@
{
MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
-
+
}
- private void getModel(string strGuid, bool isEdit, int tabIdx)
+ private void getModel(string strGuid)
{
+ bool isEdit = false;
+ if (toolBarMenu1.currentAction == "add") return;
+ if (toolBarMenu1.currentAction == "edit") isEdit = true;
if (string.IsNullOrEmpty(strGuid))
{
MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
- UtilityHelper.JumpToTab(xtraTabControl1, tabIdx);
var _obj = new
{
guid = strGuid //涓诲缓
@@ -319,10 +323,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
{
@@ -334,7 +336,11 @@
MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
}
-
+ /// <summary>
+ /// 瑙掕壊
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
private void repositoryItemButtonEdit1_ButtonClick(object sender,
ButtonPressedEventArgs e)
{
@@ -347,7 +353,11 @@
frm.ShowDialog();
}
}
-
+ /// <summary>
+ /// 瀵嗙爜
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
private void repositoryItemButtonEdit2_ButtonClick(object sender,
ButtonPressedEventArgs e)
{
@@ -360,5 +370,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