From 2a99e99dc28b76ff41c7c66a0bdb0ea68ae86ee9 Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期五, 21 三月 2025 08:10:44 +0800 Subject: [PATCH] to erp --- DevApp/Gs.DevApp/DevFrm/User/User.cs | 87 +++++++++++++++++++++++++++++++++---------- 1 files changed, 67 insertions(+), 20 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/User/User.cs b/DevApp/Gs.DevApp/DevFrm/User/User.cs index ec78126..7f39b92 100644 --- a/DevApp/Gs.DevApp/DevFrm/User/User.cs +++ b/DevApp/Gs.DevApp/DevFrm/User/User.cs @@ -25,6 +25,9 @@ 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); Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, null, "", "", (value) => { Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0); @@ -39,13 +42,13 @@ 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); + Task.Delay(100); getPageList(1); } - + /// <summary> /// 鍒嗛〉浜嬩欢 /// </summary> @@ -121,9 +124,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); @@ -172,7 +176,7 @@ return; } Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3); - UtilityHelper.ChangeEnableByControl(panel1.Controls, true); + UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true); } /// <summary> @@ -184,8 +188,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.Visible = lbPwd.Visible = true; txt_account.Enabled = txt_password.Enabled = true; } @@ -220,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(), @@ -229,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 { @@ -241,7 +246,7 @@ { lbGuid.Text = _rtn.rtnData; toolBarMenu1.isSetBtn = true; - UtilityHelper.ChangeEnableByControl(panel1.Controls, false); + UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false); } } catch (Exception ex) @@ -254,11 +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 { @@ -274,6 +279,7 @@ { gcMain.DataSource = dt; gcMain.ForceInitialize(); + gridView1.BestFitColumns(); Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gridView1); } else UtilityHelper.SetDefaultTable(gcMain, gridView1); @@ -291,7 +297,7 @@ { MsgHelper.Warning("鎻愮ず锛�" + ex.Message); } - + } private void getModel(string strGuid) @@ -317,10 +323,10 @@ { 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.Visible = + // lbPwd.Visible = tipPwd.Visible = false; } else { @@ -332,7 +338,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 +355,11 @@ frm.ShowDialog(); } } - + /// <summary> + /// 瀵嗙爜 + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> private void repositoryItemButtonEdit2_ButtonClick(object sender, ButtonPressedEventArgs e) { @@ -358,5 +372,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