From 0a2d917dba66be92bfaa628abee1a5792f0f4e7a Mon Sep 17 00:00:00 2001
From: lg <999544862qq.com>
Date: 星期三, 11 九月 2024 11:09:59 +0800
Subject: [PATCH] 日志
---
DevApp/Gs.DevApp/DevFrm/User/User.cs | 104 +++++++++++++++++++++++++++++++++++-----------------
1 files changed, 70 insertions(+), 34 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/User/User.cs b/DevApp/Gs.DevApp/DevFrm/User/User.cs
index 094e5bc..75a4ae6 100644
--- a/DevApp/Gs.DevApp/DevFrm/User/User.cs
+++ b/DevApp/Gs.DevApp/DevFrm/User/User.cs
@@ -1,9 +1,13 @@
-锘縰sing DevExpress.XtraGrid.Views.Base;
-using Gs.DevApp.Models;
+锘縰sing DevExpress.XtraEditors;
+using DevExpress.XtraGrid.Views.Base;
+using DevExpress.XtraGrid.Views.Grid;
+using DevExpress.XtraGrid.Views.Grid.ViewInfo;
+using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Newtonsoft.Json;
using System;
using System.Data;
+using System.Drawing;
using System.Windows.Forms;
namespace Gs.DevApp.DevFrm.User
@@ -19,10 +23,31 @@
this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1;
this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
+ this.toolBarMenu1.btnReportClick += ToolBarMenu1_btnReportClick;
gcMain.MouseDoubleClick += GcMain_MouseDoubleClick;
- PageBar1.PagerEvent += PageBar1_PagerEvent;
- GetPageList(1, UtilityHelper.GetPageSize());
+ gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
+ pageBar1.PagerEvent += PageBar1_PagerEvent;
+ getPageList(1, UtilityHelper.GetPageSize());
}
+
+ private void ToolBarMenu1_btnReportClick(object sender, EventArgs e)
+ {
+ Rpt.RptUser frm = new Rpt.RptUser();
+ frm.Show();
+ }
+
+ private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
+ {
+ //// 鑾峰彇GridView缁勪欢
+ //GridView view = sender as GridView;
+ //// 纭繚view涓嶄负null
+ //if (view == null) return;
+ //// 鑾峰彇搴旂敤鐨勭瓫閫夊櫒淇℃伅
+ //string filter = view.ActiveFilterString;
+ //MessageBox.Show(filter);
+ //getPageList(1, UtilityHelper.GetPageSize());
+ }
+
/// <summary>
/// 鍙屽嚮浜嬩欢
/// </summary>
@@ -30,12 +55,20 @@
/// <param name="e"></param>
private void GcMain_MouseDoubleClick(object sender, MouseEventArgs e)
{
- string rowGuid = "";
- ColumnView cv = (ColumnView)gcMain.FocusedView;
- object rowIdObj = gridView1.GetRowCellValue(cv.FocusedRowHandle, "guid");
- DataRow myDataRow = gridView1.GetDataRow(gridView1.FocusedRowHandle);
- rowGuid = myDataRow["guid"].ToString();
- GetModel(rowGuid, false, 999);
+ GridHitInfo info = gridView1.CalcHitInfo(e.Location);
+ if (info.InRow)
+ {
+ GridView view = info.View as GridView;
+ if (view != null)
+ {
+ DataRow row = view.GetDataRow(info.RowHandle);
+ if (row != null)
+ {
+ string rowGuid = (row["guid"].ToString());
+ getModel(rowGuid, false, 999);
+ }
+ }
+ }
}
/// <summary>
/// 鍒嗛〉浜嬩欢
@@ -44,7 +77,7 @@
/// <param name="pageSize"></param>
private void PageBar1_PagerEvent(int curPage, int pageSize)
{
- GetPageList(curPage, pageSize);
+ getPageList(curPage, pageSize);
}
/// <summary>
@@ -84,7 +117,7 @@
if (_rtn.rtnCode > 0)
{
UtilityHelper.ChangeTab(xtraTabControl1, 0);
- GetPageList(1, UtilityHelper.GetPageSize());
+ getPageList(1, UtilityHelper.GetPageSize());
}
ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
}
@@ -102,10 +135,8 @@
private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e)
{
UtilityHelper.ChangeTab(xtraTabControl1, 0);
- GetPageList(1, UtilityHelper.GetPageSize());
+ getPageList(1, UtilityHelper.GetPageSize());
}
-
-
/// <summary>
/// 淇敼浜嬩欢
/// </summary>
@@ -119,8 +150,7 @@
ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
- GetModel(dr["guid"].ToString(), true, 1);
-
+ getModel(dr["guid"].ToString(), true, 1);
}
/// <summary>
/// 鏂板浜嬩欢
@@ -184,10 +214,9 @@
departGuid = "",
isSys = 0
};
- string strJson = "";
try
{
- strJson = UtilityHelper.HttpPost("", "User/EditModel", JsonConvert.SerializeObject(_obj));
+ string strJson = UtilityHelper.HttpPost("", "User/EditModel", JsonConvert.SerializeObject(_obj));
ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.GetDataByJson(strJson);
ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
if (_rtn.rtnCode > 0)
@@ -203,39 +232,36 @@
}
}
-
/// <summary>
///
/// </summary>
/// <param name="curPage">绗嚑椤�</param>
/// <param name="pageSize">姣忛〉鍑犳潯</param>
- private void GetPageList(int curPage, int pageSize)
+ private void getPageList(int curPage, int pageSize)
{
- Models.PageQueryModel pgq = new Models.PageQueryModel(curPage, pageSize, "createTime", "asc", "", "");
+ PageQueryModel pgq = new PageQueryModel(curPage, pageSize, "createTime", "asc", "", "");
string json = JsonConvert.SerializeObject(pgq);
- string strReturn = "";
try
{
- strReturn = UtilityHelper.HttpPost("", "User/GetListPage", json);
+ string strReturn = UtilityHelper.HttpPost("", "User/GetListPage", json);
ReturnModel<PageListModel> dd = UtilityHelper.GetTableByJson(strReturn);
DataTable dt = dd.rtnData.list;
gcMain.BindingContext = new BindingContext();
gcMain.DataSource = dt;
gcMain.ForceInitialize();
int dddd = dd.rtnData.pages;//鎬婚〉
- PageBar1.TotalPages = dddd;
- PageBar1.RecordCount = dd.rtnData.total;//璁板綍鎬绘暟
- PageBar1.CurrentPage = curPage;//褰撳墠椤�
- PageBar1.RowsCount = pageSize;//姣忛〉鏄剧ず
- PageBar1.setTxt();
+ pageBar1.TotalPages = dddd;
+ pageBar1.RecordCount = dd.rtnData.total;//璁板綍鎬绘暟
+ pageBar1.CurrentPage = curPage;//褰撳墠椤�
+ pageBar1.RowsCount = pageSize;//姣忛〉鏄剧ず
+ pageBar1.setTxt();
}
catch (Exception ex)
{
ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
}
-
- private void GetModel(string strGuid, bool isEdit, int tabIdx)
+ private void getModel(string strGuid, bool isEdit, int tabIdx)
{
if (string.IsNullOrEmpty(strGuid))
{
@@ -247,10 +273,9 @@
{
guid = strGuid,//涓诲缓
};
- string strJson = "";
try
{
- strJson = UtilityHelper.HttpPost("", "User/GetModel", JsonConvert.SerializeObject(_obj));
+ string strJson = UtilityHelper.HttpPost("", "User/GetModel", JsonConvert.SerializeObject(_obj));
ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.GetDataByJson(strJson);
if (_rtn.rtnCode > 0)
{
@@ -258,7 +283,7 @@
lbGuid.Text = strGuid;
UtilityHelper.SetValueByObj(this.panel1.Controls, dy, isEdit);
txt_account.Enabled = false;
- txt_password.Enabled = txt_password.Visible = lbPwd.Visible = false;
+ txt_password.Enabled = txt_password.Visible = lbPwd.Visible = tipPwd.Visible = false;
}
else
ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
@@ -268,6 +293,17 @@
ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
}
+ private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
+ {
+ if (e.Button.Index == 0)
+ {
+ int rowhandle = gridView1.FocusedRowHandle;
+ DataRow dr = gridView1.GetDataRow(rowhandle);
+ string userGuid = dr["guid"].ToString();
+ UserSelectRole frm = new UserSelectRole(userGuid);
+ frm.ShowDialog();
+ }
+ }
}
}
--
Gitblit v1.9.3