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/WW/Frm_WwPc.cs | 62 ++++++++++++++++++------------- 1 files changed, 36 insertions(+), 26 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/WW/Frm_WwPc.cs b/DevApp/Gs.DevApp/DevFrm/WW/Frm_WwPc.cs index 983cfb4..8f7ece1 100644 --- a/DevApp/Gs.DevApp/DevFrm/WW/Frm_WwPc.cs +++ b/DevApp/Gs.DevApp/DevFrm/WW/Frm_WwPc.cs @@ -28,18 +28,18 @@ toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick; toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick; this.toolBarMenu1.getXmlConfig(); - Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx( gvMx1); - Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter( gridView1, picCheckBox, this, "shChk", "", (value) => + Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1); + Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "shChk", "", (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; ////閫夋嫨闇�瑕佸叆搴撶殑鏄庣粏 @@ -79,7 +79,7 @@ } 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); } @@ -100,7 +100,10 @@ /// <param name="e"></param> private void ToolBarMenu1_btnQueryClick(object sender, EventArgs e) { - Gs.DevApp.UserControl.ShowFilter frm = new Gs.DevApp.UserControl.ShowFilter(gridView1.Columns, _filterList); + gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged; + gridView1.ActiveFilter.Clear(); + gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged; + var frm = new ShowFilter(gridView1.Columns, _filterList, this.GetType().FullName); frm.UpdateParent += Frm_UpdateParent; frm.ShowDialog(); } @@ -111,12 +114,8 @@ /// <param name="e"></param> private void Frm_UpdateParent(object sender, UpdateParentEventArgs e) { - gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged; - gridView1.ActiveFilter.Clear(); - gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged; - var frm = new ShowFilter(gridView1.Columns, _filterList); - frm.UpdateParent += Frm_UpdateParent; - frm.ShowDialog(); + _filterList = e.FilterList; + getPageList(1); } /// <summary> /// 瀹℃牳浜嬩欢 @@ -222,17 +221,28 @@ /// <param name="e"></param> private void ToolBarMenu1_btnEdtClick(object sender, EventArgs e) { - string rowGuid = "", rowName = ""; - (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_hNo, gridView1); + string rowGuid, rowName; + (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, + lbGuid, txt_hNo, gridView1); if (string.IsNullOrEmpty(rowGuid)) { - ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); + MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); return; } Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3); - List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); - gvList.Add(gvMx1); - UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gvList); + + if (xtraTabControl1.SelectedTabPageIndex == 1) + { + getModel(rowGuid); + + } + else + { + List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); + gvList.Add(gvMx1); + UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gvList); + } + } /// <summary> /// 鏂板浜嬩欢 @@ -263,6 +273,7 @@ list = new List<dynamic>(), }; gvMx1.CloseEditor(); + gvMx1.PostEditor(); gvMx1.UpdateCurrentRow(); if (gvMx1.DataRowCount <= 0) { @@ -311,12 +322,14 @@ ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); if (_rtn.rtnCode > 0) { - lbGuid.Text = _rtn.rtnData; + lbGuid.Text = _rtn.rtnData.outGuid; txt_hNo.Text = _rtn.rtnData.outNo; toolBarMenu1.isSetBtn = true; List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); gvList.Add(gvMx1); UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false, gvList); + toolBarMenu1.currentAction = ""; + Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6); } } catch (Exception ex) @@ -349,7 +362,7 @@ { gcMain1.DataSource = dt; gcMain1.ForceInitialize(); - gridView1.BestFitColumns(); + gridView1.BestFitColumns(); Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gridView1); } else UtilityHelper.SetDefaultTable(gcMain1, gridView1); @@ -372,15 +385,11 @@ private void getModel(string strGuid) { bool isEdit = false; - if (toolBarMenu1.currentAction == "add") - { - Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1); - return; - }; + if (toolBarMenu1.currentAction == "add") return; if (toolBarMenu1.currentAction == "edit") isEdit = true; if (string.IsNullOrEmpty(strGuid)) { - ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); + MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); return; } var _obj = new @@ -411,6 +420,7 @@ gcMx1.DataSource = dt; gcMx1.ForceInitialize(); gvMx1.BestFitColumns(); + Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1); } else { -- Gitblit v1.9.3