From f990a7fbeb2576a5d2e3e97d876fee3a54f376a1 Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期日, 22 十二月 2024 21:59:17 +0800 Subject: [PATCH] 细节 --- DevApp/Gs.DevApp/DevFrm/QC/Frm_MesSysLookups.Designer.cs | 6 DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.Designer.cs | 12 + DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl.Designer.cs | 14 + DevApp/Gs.DevApp/DevFrm/QC/Frm_MesDefectType.cs | 50 ++-- DevApp/Gs.DevApp/UserControl/UcBtnPrint.Designer.cs | 22 +- DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs | 112 +++++----- DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQmAql1.cs | 57 ++-- DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs | 40 +++ DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl.cs | 40 +++ DevApp/Gs.DevApp/DevFrm/QC/Frm_MesDefectCode.cs | 51 ++-- DevApp/Gs.DevApp/UserControl/UcBtnPrint.cs | 107 +++++++++ DevApp/Gs.DevApp/DevFrm/QC/Frm_MesSysLookups.cs | 52 ++-- DevApp/Gs.DevApp/DevFrm/QC/Frm_IQCLookups.cs | 51 ++-- 13 files changed, 406 insertions(+), 208 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_IQCLookups.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_IQCLookups.cs index ec49968..aab3a92 100644 --- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_IQCLookups.cs +++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_IQCLookups.cs @@ -29,30 +29,27 @@ toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick; toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick; toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick; - - Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "checkStatus", ""); + Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1); + Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "checkStatus", "", (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); pageBar1.PagerEvent += PageBar1_PagerEvent; - Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1); + } private void GridView1_ColumnFilterChanged(object sender, EventArgs e) { _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns); 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> @@ -92,7 +89,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> @@ -103,7 +100,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(); @@ -132,7 +129,8 @@ MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); return; } - getModel(rowGuid, true, 1); + Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3); + UtilityHelper.ChangeEnableByControl(panel1.Controls, true); } /// <summary> @@ -185,7 +183,7 @@ { lbGuid.Text = _rtn.rtnData; toolBarMenu1.isSetBtn = true; - getModel(lbGuid.Text, false, 1); + getModel(lbGuid.Text); } } catch (Exception ex) @@ -236,15 +234,16 @@ } } - 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 //涓诲缓 @@ -322,7 +321,7 @@ JsonConvert.SerializeObject(lst)); var _rtn = UtilityHelper.ReturnToDynamic(strJson); - if (_rtn.rtnCode > 0) getModel(lbGuid.Text, true, 1); + if (_rtn.rtnCode > 0) getModel(lbGuid.Text); MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); } @@ -376,9 +375,9 @@ if (_rtn.rtnCode > 0) { if (xtraTabControl1.SelectedTabPageIndex == 1) - getModel(lbGuid.Text.Trim(), false, 999); + getModel(lbGuid.Text.Trim()); else - getPageList(1); + getPageList(this.pageBar1.CurrentPage); } } catch (Exception ex) diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesDefectCode.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesDefectCode.cs index dba75ff..babe67f 100644 --- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesDefectCode.cs +++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesDefectCode.cs @@ -25,10 +25,17 @@ this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1; this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick; this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick; - - Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1); - getPageList(1); - pageBar1.PagerEvent += PageBar1_PagerEvent; + 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); + }); txt_pid.EditChanged += (s, e) => { txt_typeMemo.Text = this.txt_pid.GetMemo(); @@ -41,17 +48,7 @@ await Task.Delay(100); getPageList(1); } - /// <summary> - /// 鍙屽嚮浜嬩欢 - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - private void GcMain_MouseDoubleClick(object sender, MouseEventArgs e) - { - string rowGuid = Gs.DevApp.ToolBox.UtilityHelper.GetCurrentDoubleRow(gridView1, e, "guid"); - if (!string.IsNullOrEmpty(rowGuid)) - getModel(rowGuid, false, 999); - } + /// <summary> /// 鍒嗛〉浜嬩欢 /// </summary> @@ -93,7 +90,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> @@ -121,8 +118,10 @@ ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); if (_rtn.rtnCode > 0) { - UtilityHelper.JumpToTab(xtraTabControl1, 0); - getPageList(1); + if (xtraTabControl1.SelectedTabPageIndex == 0) + getPageList(this.pageBar1.CurrentPage); + else + Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2); } ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); } @@ -140,7 +139,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(); @@ -167,7 +166,8 @@ ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); return; } - getModel(rowGuid, true, 1); + Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3); + UtilityHelper.ChangeEnableByControl(panel1.Controls, true); } /// <summary> /// 鏂板浜嬩欢 @@ -176,9 +176,9 @@ /// <param name="e"></param> private void ToolBarMenu1_btnAddClick(object sender, EventArgs e) { - UtilityHelper.JumpToTab(xtraTabControl1, 1); lbGuid.Text = ""; - UtilityHelper.CleanValueByControl(this.panel1.Controls, true); + Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4); + UtilityHelper.CleanValueByControl(panel1.Controls, true); } /// <summary> @@ -285,14 +285,16 @@ /// <param name="strGuid">涓婚敭</param> /// <param name="isEdit">鏄惁鍙紪杈�</param> /// <param name="tabIdx">閫夐」鍗″簭鍙�</param> - 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)) { ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); return; } - UtilityHelper.JumpToTab(xtraTabControl1, tabIdx); var _obj = new { guid = strGuid,//涓诲缓 @@ -306,7 +308,6 @@ dynamic dy = _rtn.rtnData; lbGuid.Text = strGuid; UtilityHelper.SetValueByObj(this.panel1.Controls, dy, isEdit); - } else ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesDefectType.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesDefectType.cs index 7956bc8..78543c2 100644 --- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesDefectType.cs +++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesDefectType.cs @@ -25,8 +25,17 @@ this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1; this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick; this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick; - - Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1); + 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); pageBar1.PagerEvent += PageBar1_PagerEvent; } @@ -36,17 +45,7 @@ await Task.Delay(100); getPageList(1); } - /// <summary> - /// 鍙屽嚮浜嬩欢 - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - private void GcMain_MouseDoubleClick(object sender, MouseEventArgs e) - { - string rowGuid = Gs.DevApp.ToolBox.UtilityHelper.GetCurrentDoubleRow(gridView1, e, "guid"); - if (!string.IsNullOrEmpty(rowGuid)) - getModel(rowGuid, false, 999); - } + /// <summary> /// 鍒嗛〉浜嬩欢 /// </summary> @@ -88,7 +87,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> @@ -116,8 +115,10 @@ ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); if (_rtn.rtnCode > 0) { - UtilityHelper.JumpToTab(xtraTabControl1, 0); - getPageList(1); + if (xtraTabControl1.SelectedTabPageIndex == 0) + getPageList(this.pageBar1.CurrentPage); + else + Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2); } ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); } @@ -135,7 +136,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(); @@ -162,7 +163,8 @@ ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); return; } - getModel(rowGuid, true, 1); + Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3); + UtilityHelper.ChangeEnableByControl(panel1.Controls, true); } /// <summary> /// 鏂板浜嬩欢 @@ -171,10 +173,9 @@ /// <param name="e"></param> private void ToolBarMenu1_btnAddClick(object sender, EventArgs e) { - UtilityHelper.JumpToTab(xtraTabControl1, 1); lbGuid.Text = ""; - UtilityHelper.CleanValueByControl(this.panel1.Controls, true); - + Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4); + UtilityHelper.CleanValueByControl(panel1.Controls, true); } /// <summary> /// 淇濆瓨浜嬩欢 @@ -221,7 +222,6 @@ /// <param name="pageSize">姣忛〉鍑犳潯</param> private void getPageList(int curPage) { - var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); var pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "a.type_no", "asc", "", _sbSqlWhere.ToString()); @@ -265,14 +265,16 @@ /// <param name="strGuid">涓婚敭</param> /// <param name="isEdit">鏄惁鍙紪杈�</param> /// <param name="tabIdx">閫夐」鍗″簭鍙�</param> - 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)) { ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); return; } - UtilityHelper.JumpToTab(xtraTabControl1, tabIdx); var _obj = new { guid = strGuid,//涓诲缓 diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQmAql1.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQmAql1.cs index a13659d..d05e320 100644 --- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQmAql1.cs +++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQmAql1.cs @@ -31,11 +31,20 @@ toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick; toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick; toolBarMenu1.btnPiZhunClick += ToolBarMenu1_btnPiZhunClick; - - Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "foneChecked", ""); + Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2); + Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "foneChecked", "", (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); pageBar1.PagerEvent += PageBar1_PagerEvent; - Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2); } private void GridView1_ColumnFilterChanged(object sender, EventArgs e) { @@ -59,8 +68,7 @@ ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); if (_rtn.rtnCode > 0) { - UtilityHelper.JumpToTab(xtraTabControl1, 0); - getPageList(1); + getPageList(this.pageBar1.CurrentPage); } ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); } @@ -98,18 +106,7 @@ lbGuid, txt_sampleSizeNo, gridView1); toolBarMenu1.guidKey = rowGuid; } - - /// <summary> - /// 鍙屽嚮浜嬩欢 - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - private void GcMain_MouseDoubleClick(object sender, MouseEventArgs e) - { - string rowGuid = Gs.DevApp.ToolBox.UtilityHelper.GetCurrentDoubleRow(gridView1, e, "guid"); - if (!string.IsNullOrEmpty(rowGuid)) - getModel(rowGuid, false, 999); - } + /// <summary> /// 鍒嗛〉浜嬩欢 /// </summary> @@ -150,7 +147,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> @@ -178,8 +175,10 @@ ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); if (_rtn.rtnCode > 0) { - UtilityHelper.JumpToTab(xtraTabControl1, 0); - getPageList(1); + if (xtraTabControl1.SelectedTabPageIndex == 0) + getPageList(this.pageBar1.CurrentPage); + else + Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2); } ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); } @@ -197,7 +196,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(); @@ -224,7 +223,8 @@ ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); return; } - getModel(rowGuid, true, 1); + Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3); + UtilityHelper.ChangeEnableByControl(panel1.Controls, true); } /// <summary> /// 鏂板浜嬩欢 @@ -233,8 +233,8 @@ /// <param name="e"></param> private void ToolBarMenu1_btnAddClick(object sender, EventArgs e) { - UtilityHelper.JumpToTab(xtraTabControl1, 1); lbGuid.Text = ""; + Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4); List<GridView> gridViews = new List<GridView>(); gridViews.Add(gvMx1); gridViews.Add(gvMx2); @@ -243,6 +243,7 @@ UtilityHelper.SetDefaultTable(gcMx2, gvMx2); txt_createDate.Text = DateTime.Now.ToString("G"); txt_fversion.Text = "1"; + } /// <summary> /// 淇濆瓨浜嬩欢 @@ -404,14 +405,16 @@ ToolBox.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)) { ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); return; } - UtilityHelper.JumpToTab(xtraTabControl1, tabIdx); var _obj = new { guid = strGuid,//涓诲缓 @@ -499,7 +502,7 @@ JsonConvert.SerializeObject(lst)); var _rtn = UtilityHelper.ReturnToDynamic(strJson); - if (_rtn.rtnCode > 0) getModel(lbGuid.Text, true, 1); + if (_rtn.rtnCode > 0) getModel(lbGuid.Text); MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); } @@ -538,7 +541,7 @@ JsonConvert.SerializeObject(lst)); var _rtn = UtilityHelper.ReturnToDynamic(strJson); - if (_rtn.rtnCode > 0) getModel(lbGuid.Text, true, 1); + if (_rtn.rtnCode > 0) getModel(lbGuid.Text); MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); } diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesSysLookups.Designer.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesSysLookups.Designer.cs index c3370c0..1cf2bdb 100644 --- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesSysLookups.Designer.cs +++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesSysLookups.Designer.cs @@ -226,6 +226,7 @@ // toolBarMenu1 // this.toolBarMenu1.chkParameter = "MES_SYS_LOOKUP_TYPES,check_date,check_status,check_by"; + this.toolBarMenu1.currentAction = null; this.toolBarMenu1.Dock = System.Windows.Forms.DockStyle.Top; this.toolBarMenu1.guidKey = null; this.toolBarMenu1.isSetBtn = false; @@ -292,12 +293,12 @@ // this.gridColumn1.Caption = "瀹℃牳鏃堕棿"; this.gridColumn1.FieldName = "checkDate"; - this.gridColumn1.MinWidth = 25; + this.gridColumn1.MinWidth = 250; this.gridColumn1.Name = "gridColumn1"; this.gridColumn1.OptionsColumn.AllowEdit = false; this.gridColumn1.Visible = true; this.gridColumn1.VisibleIndex = 4; - this.gridColumn1.Width = 94; + this.gridColumn1.Width = 250; // // xtraTabControl1 // @@ -336,7 +337,6 @@ this.xtraTabPage2.Controls.Add(this.tabMx); this.xtraTabPage2.Controls.Add(this.panel1); this.xtraTabPage2.Name = "xtraTabPage2"; - this.xtraTabPage2.Size = new System.Drawing.Size(1126, 570); this.xtraTabPage2.Text = "鏁版嵁璇︾粏"; // diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesSysLookups.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesSysLookups.cs index 36a57f6..2655c60 100644 --- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesSysLookups.cs +++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesSysLookups.cs @@ -1,14 +1,11 @@ using System; using System.Collections.Generic; using System.Data; -using System.Drawing; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; -using DevExpress.RichEdit.Export; using DevExpress.XtraEditors; using DevExpress.XtraEditors.Controls; -using DevExpress.XtraGrid.Views.Base.ViewInfo; using DevExpress.XtraGrid.Views.Grid; using Gs.DevApp.DevFrm.QC.Models; using Gs.DevApp.Entity; @@ -32,11 +29,20 @@ toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick; toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick; toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick; - - Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "checkStatus", ""); + Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1); + Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "checkStatus", "", (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); pageBar1.PagerEvent += PageBar1_PagerEvent; - Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1); } private void GridView1_ColumnFilterChanged(object sender, EventArgs e) { @@ -44,20 +50,6 @@ 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> /// 鍒嗛〉浜嬩欢 /// </summary> @@ -94,7 +86,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> @@ -105,7 +97,7 @@ private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e) { if (xtraTabControl1.SelectedTabPageIndex == 1) - getModel(lbGuid.Text.Trim(), false, 999); + getModel(lbGuid.Text.Trim()); else getPageList(1); } @@ -125,7 +117,8 @@ MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); return; } - getModel(rowGuid, true, 1); + Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3); + UtilityHelper.ChangeEnableByControl(panel1.Controls, true); } /// <summary> @@ -231,15 +224,16 @@ } } - 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,7 +313,7 @@ JsonConvert.SerializeObject(lst)); var _rtn = UtilityHelper.ReturnToDynamic(strJson); - if (_rtn.rtnCode > 0) getModel(lbGuid.Text, true, 1); + if (_rtn.rtnCode > 0) getModel(lbGuid.Text); MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); } @@ -371,9 +365,9 @@ if (_rtn.rtnCode > 0) { if (xtraTabControl1.SelectedTabPageIndex == 1) - getModel(lbGuid.Text.Trim(), false, 999); + getModel(lbGuid.Text.Trim()); else - getPageList(1); + getPageList(this.pageBar1.CurrentPage); } } catch (Exception ex) diff --git a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs index 97c8615..b79e22a 100644 --- a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs +++ b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs @@ -29,8 +29,8 @@ this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick; toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick; toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick; - toolBarMenu1.btnReportClick += ToolBarMenu1_btnReportClick; - toolBarMenu1.btnDesignClick += ToolBarMenu1_btnDesignClick; + //toolBarMenu1.btnReportClick += ToolBarMenu1_btnReportClick; + //toolBarMenu1.btnDesignClick += ToolBarMenu1_btnDesignClick; Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1); Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "qt015", "", (value) => { @@ -78,14 +78,53 @@ MsgHelper.Warning("鎻愮ず锛�" + ex.Message); } gcMx1.MouseClick += GcMx1_MouseClick; + this.ucBtnPrint1.btnDesignClick += (s, e) => + { + ucBtnPrint1.rptParameter = "rpt_Qtrk{}"; + }; + this.ucBtnPrint1.btnReportClick += (s, e) => + { + ucBtnPrint1.guidKey = ""; + string rowGuid = lbMxGuid.Text.Trim(); + ucBtnPrint1.guidKey = rowGuid; + if (string.IsNullOrEmpty(txt_iCount_1.Text.Trim())) + { + Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜寮犳暟锛�"); + txt_iCount_1.Focus(); + this.ucBtnPrint1.rptParameter = "return false"; + return; + } + if (string.IsNullOrEmpty(txt_psnQty_1.Text.Trim())) + { + Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜鏁伴噺锛�"); + txt_psnQty_1.Focus(); + this.ucBtnPrint1.rptParameter = "return false"; + return; + } + if (lbMxGuid.Text.Trim().Length < 10) + { + Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鐨勮锛�"); + this.ucBtnPrint1.rptParameter = "return false"; + return; + } + this.ucBtnPrint1.rptParameter = "rpt_Qtrk{" + lbMxGuid.Text.Trim() + + "," + "" + + "," + "" + + "," + txt_iCount_1.Text.Trim() + + "," + txt_psnQty_1.Text.Trim() + + "}"; + }; } - 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); + Task.Delay(100); getPageList(1); } - + /// <summary> /// 鍒嗛〉浜嬩欢 /// </summary> @@ -121,52 +160,11 @@ } private void ToolBarMenu1_btnDesignClick(object sender, EventArgs e) { - toolBarMenu1.guidKey = ""; - string rowGuid, rowName; - (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, - lbGuid, txt_qtck, gridView1); - toolBarMenu1.guidKey = rowGuid; - toolBarMenu1.rptParameter = "rpt_Qtrk{}"; + } private void ToolBarMenu1_btnReportClick(object sender, EventArgs e) { - toolBarMenu1.guidKey = ""; - string rowGuid, rowName; - (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, - lbGuid, txt_qtck, gridView1); - toolBarMenu1.guidKey = rowGuid; - if (xtraTabControl1.SelectedTabPageIndex == 0) - { - getModel(rowGuid); - this.toolBarMenu1.rptParameter = "return false"; - return; - } - if (string.IsNullOrEmpty(txt_iCount_1.Text.Trim())) - { - Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜寮犳暟锛�"); - txt_iCount_1.Focus(); - this.toolBarMenu1.rptParameter = "return false"; - return; - } - if (string.IsNullOrEmpty(txt_psnQty_1.Text.Trim())) - { - Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜鏁伴噺锛�"); - txt_psnQty_1.Focus(); - this.toolBarMenu1.rptParameter = "return false"; - return; - } - if (lbMxGuid.Text.Trim().Length < 10) - { - Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鐨勮锛�"); - this.toolBarMenu1.rptParameter = "return false"; - return; - } - this.toolBarMenu1.rptParameter = "rpt_Qtrk{" + lbMxGuid.Text.Trim() - + "," + "" - + "," + "" - + "," + txt_iCount_1.Text.Trim() - + "," + txt_psnQty_1.Text.Trim() - + "}"; + } /// <summary> @@ -363,9 +361,9 @@ /// </summary> /// <param name="curPage">绗嚑椤�</param> /// <param name="pageSize">姣忛〉鍑犳潯</param> - private void getPageList(int curPage) + private void getPageList(int curPage) { - + var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "qt001", "asc", "", _sbSqlWhere.ToString()); string json = JsonConvert.SerializeObject(pgq); @@ -399,7 +397,7 @@ { ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message); } - + } private void getModel(string strGuid) { @@ -508,7 +506,7 @@ /// </summary> /// <param name="sender"></param> /// <param name="e"></param> - private void ToolBarMenu1_btnChkClick(object sender, EventArgs e) + private void ToolBarMenu1_btnChkClick(object sender, EventArgs e) { _toolCk(1); } @@ -519,7 +517,7 @@ /// <param name="sender"></param> /// <param name="e"></param> /// <exception cref="NotImplementedException"></exception> - private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e) + private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e) { _toolCk(0); } @@ -528,7 +526,7 @@ /// 宸ュ叿鏉′簨浠� /// </summary> /// <param name="inFieldValue"></param> - private void _toolCk(int _inFieldValue) + private void _toolCk(int _inFieldValue) { string strMsg = ""; switch (_inFieldValue) @@ -551,7 +549,7 @@ } if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾" + strMsg + "鍚楋紵")) return; - + var _obj = new { guid = rowGuid, @@ -576,7 +574,7 @@ { MsgHelper.Warning("鎻愮ず锛�" + ex.Message); } - + } private void GcMx1_MouseClick(object sender, MouseEventArgs e) @@ -585,7 +583,7 @@ if (string.IsNullOrEmpty(rowGuid)) return; lbMxGuid.Text = rowGuid; - toolBarMenu1.guidKey = rowGuid; + ucBtnPrint1.guidKey = rowGuid; var info = gvMx1.CalcHitInfo(e.Location); var view = info.View; var row = view.GetDataRow(info.RowHandle); diff --git a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl.Designer.cs b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl.Designer.cs index 9451777..3fd3881 100644 --- a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl.Designer.cs +++ b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl.Designer.cs @@ -132,6 +132,7 @@ this.labelControl11 = new DevExpress.XtraEditors.LabelControl(); this.lbGuid = new System.Windows.Forms.Label(); this.picCheckBox = new System.Windows.Forms.PictureBox(); + this.ucBtnPrint1 = new Gs.DevApp.UserControl.UcBtnPrint(); this.tabMxPage1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.gcMx1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.gvMx1)).BeginInit(); @@ -381,6 +382,7 @@ // // panelMx1 // + this.panelMx1.Controls.Add(this.ucBtnPrint1); this.panelMx1.Controls.Add(this.lbMxGuid); this.panelMx1.Controls.Add(this.txt_iCount_1); this.panelMx1.Controls.Add(this.labelControl14); @@ -406,7 +408,7 @@ // // lbMxGuid // - this.lbMxGuid.Location = new System.Drawing.Point(552, 75); + this.lbMxGuid.Location = new System.Drawing.Point(821, 14); this.lbMxGuid.Name = "lbMxGuid"; this.lbMxGuid.Size = new System.Drawing.Size(58, 18); this.lbMxGuid.TabIndex = 229; @@ -1341,6 +1343,15 @@ this.picCheckBox.TabStop = false; this.picCheckBox.Visible = false; // + // ucBtnPrint1 + // + this.ucBtnPrint1.guidKey = null; + this.ucBtnPrint1.Location = new System.Drawing.Point(543, 59); + this.ucBtnPrint1.Name = "ucBtnPrint1"; + this.ucBtnPrint1.rptParameter = null; + this.ucBtnPrint1.Size = new System.Drawing.Size(218, 41); + this.ucBtnPrint1.TabIndex = 231; + // // Frm_MesItemTbl // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F); @@ -1502,5 +1513,6 @@ private DevExpress.XtraGrid.Columns.GridColumn gvMxDel; private DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit repositoryItemButtonEdit1; private System.Windows.Forms.PictureBox picCheckBox; + private UserControl.UcBtnPrint ucBtnPrint1; } } \ No newline at end of file diff --git a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl.cs b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl.cs index b1de19b..c2cf57a 100644 --- a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl.cs +++ b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl.cs @@ -27,8 +27,8 @@ this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick; toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick; toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick; - toolBarMenu1.btnReportClick += ToolBarMenu1_btnReportClick; - toolBarMenu1.btnDesignClick += ToolBarMenu1_btnDesignClick; + //toolBarMenu1.btnReportClick += ToolBarMenu1_btnReportClick; + //toolBarMenu1.btnDesignClick += ToolBarMenu1_btnDesignClick; Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1); Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "tbl013", "", (value) => { @@ -85,6 +85,42 @@ }; gcMx1.MouseClick += GcMx1_MouseClick; + this.ucBtnPrint1.btnDesignClick += (s, e) => + { + ucBtnPrint1.rptParameter = "rpt_SCTL{}"; + }; + this.ucBtnPrint1.btnReportClick += (s, e) => + { + ucBtnPrint1.guidKey = ""; + string rowGuid = lbMxGuid.Text.Trim(); + ucBtnPrint1.guidKey = rowGuid; + if (string.IsNullOrEmpty(txt_iCount_1.Text.Trim())) + { + Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜寮犳暟锛�"); + txt_iCount_1.Focus(); + this.ucBtnPrint1.rptParameter = "return false"; + return; + } + if (string.IsNullOrEmpty(txt_psnQty_1.Text.Trim())) + { + Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜鏁伴噺锛�"); + txt_psnQty_1.Focus(); + this.ucBtnPrint1.rptParameter = "return false"; + return; + } + if (lbMxGuid.Text.Trim().Length < 10) + { + Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鐨勮锛�"); + this.ucBtnPrint1.rptParameter = "return false"; + return; + } + this.ucBtnPrint1.rptParameter = "rpt_SCTL{" + lbMxGuid.Text.Trim() + + "," + "" + + "," + "" + + "," + txt_iCount_1.Text.Trim() + + "," + txt_psnQty_1.Text.Trim() + + "}"; + }; } private async void GridView1_ColumnFilterChanged(object sender, EventArgs e) { diff --git a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.Designer.cs b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.Designer.cs index 27f0a05..1fe7d32 100644 --- a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.Designer.cs +++ b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.Designer.cs @@ -134,6 +134,7 @@ this.txt_createBy = new DevExpress.XtraEditors.TextEdit(); this.lb_billNo = new DevExpress.XtraEditors.LabelControl(); this.txt_billNo = new DevExpress.XtraEditors.TextEdit(); + this.ucBtnPrint1 = new Gs.DevApp.UserControl.UcBtnPrint(); this.tabMxPage2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.gcMx2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.gvMx2)).BeginInit(); @@ -569,6 +570,7 @@ // // panelMx1 // + this.panelMx1.Controls.Add(this.ucBtnPrint1); this.panelMx1.Controls.Add(this.lbMxGuid); this.panelMx1.Controls.Add(this.txt_iCount_1); this.panelMx1.Controls.Add(this.labelControl14); @@ -1319,6 +1321,15 @@ this.txt_billNo.Size = new System.Drawing.Size(215, 28); this.txt_billNo.TabIndex = 211; // + // ucBtnPrint1 + // + this.ucBtnPrint1.guidKey = null; + this.ucBtnPrint1.Location = new System.Drawing.Point(543, 59); + this.ucBtnPrint1.Name = "ucBtnPrint1"; + this.ucBtnPrint1.rptParameter = null; + this.ucBtnPrint1.Size = new System.Drawing.Size(218, 41); + this.ucBtnPrint1.TabIndex = 232; + // // Frm_ArrivalBarcode // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F); @@ -1472,5 +1483,6 @@ private DevExpress.XtraGrid.Columns.GridColumn gridColumn6; private DevExpress.XtraEditors.LabelControl lbMxGuid; private DevExpress.XtraGrid.Columns.GridColumn gridColumn10; + private UserControl.UcBtnPrint ucBtnPrint1; } } \ No newline at end of file diff --git a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs index 699ef10..e406242 100644 --- a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs +++ b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs @@ -20,8 +20,8 @@ InitializeComponent(); this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick; this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick; - toolBarMenu1.btnReportClick += ToolBarMenu1_btnReportClick; - toolBarMenu1.btnDesignClick += ToolBarMenu1_btnDesignClick; + //toolBarMenu1.btnReportClick += ToolBarMenu1_btnReportClick; + //toolBarMenu1.btnDesignClick += ToolBarMenu1_btnDesignClick; Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1); Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2); Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, null, "", "", (value) => @@ -50,6 +50,42 @@ txtSupplierId.Text = this.txt_suppId.GetId(); }; gcMx1.MouseClick += GcMx1_MouseClick; + this.ucBtnPrint1.btnDesignClick += (s, e) => + { + ucBtnPrint1.rptParameter = "rpt_Arrival{}"; + }; + this.ucBtnPrint1.btnReportClick += (s, e) => + { + ucBtnPrint1.guidKey = ""; + string rowGuid = lbMxGuid.Text.Trim(); + ucBtnPrint1.guidKey = rowGuid; + if (string.IsNullOrEmpty(txt_iCount_1.Text.Trim())) + { + Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜寮犳暟锛�"); + txt_iCount_1.Focus(); + this.ucBtnPrint1.rptParameter = "return false"; + return; + } + if (string.IsNullOrEmpty(txt_psnQty_1.Text.Trim())) + { + Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜鏁伴噺锛�"); + txt_psnQty_1.Focus(); + this.ucBtnPrint1.rptParameter = "return false"; + return; + } + if (lbMxGuid.Text.Trim().Length < 10) + { + Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鐨勮锛�"); + this.ucBtnPrint1.rptParameter = "return false"; + return; + } + this.ucBtnPrint1.rptParameter = "rpt_Arrival{" + lbMxGuid.Text.Trim() + + "," + "" + + "," + "" + + "," + txt_iCount_1.Text.Trim() + + "," + txt_psnQty_1.Text.Trim() + + "}"; + }; } private void GridView1_ColumnFilterChanged(object sender, EventArgs e) { diff --git a/DevApp/Gs.DevApp/UserControl/UcBtnPrint.Designer.cs b/DevApp/Gs.DevApp/UserControl/UcBtnPrint.Designer.cs index c1ca443..4ec6b9c 100644 --- a/DevApp/Gs.DevApp/UserControl/UcBtnPrint.Designer.cs +++ b/DevApp/Gs.DevApp/UserControl/UcBtnPrint.Designer.cs @@ -28,18 +28,18 @@ /// </summary> private void InitializeComponent() { - this.btnPrint = new DevExpress.XtraEditors.SimpleButton(); + this.btnReport = new DevExpress.XtraEditors.SimpleButton(); this.btnDesign = new DevExpress.XtraEditors.SimpleButton(); this.SuspendLayout(); // - // btnPrint + // btnReport // - this.btnPrint.ImageOptions.Image = global::Gs.DevApp.Properties.Resources.printernetwork_16x16; - this.btnPrint.Location = new System.Drawing.Point(115, 4); - this.btnPrint.Name = "btnPrint"; - this.btnPrint.Size = new System.Drawing.Size(94, 29); - this.btnPrint.TabIndex = 3; - this.btnPrint.Text = "纭畾鎵撳嵃"; + this.btnReport.ImageOptions.Image = global::Gs.DevApp.Properties.Resources.printernetwork_16x16; + this.btnReport.Location = new System.Drawing.Point(115, 4); + this.btnReport.Name = "btnReport"; + this.btnReport.Size = new System.Drawing.Size(94, 29); + this.btnReport.TabIndex = 3; + this.btnReport.Text = "纭畾鎵撳嵃"; // // btnDesign // @@ -48,13 +48,13 @@ this.btnDesign.Name = "btnDesign"; this.btnDesign.Size = new System.Drawing.Size(94, 29); this.btnDesign.TabIndex = 2; - this.btnDesign.Text = "妯℃澘璁剧疆"; + this.btnDesign.Text = "鎵撳嵃璁捐"; // // UcBtnPrint // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.btnPrint); + this.Controls.Add(this.btnReport); this.Controls.Add(this.btnDesign); this.Name = "UcBtnPrint"; this.Size = new System.Drawing.Size(214, 36); @@ -64,7 +64,7 @@ #endregion - private DevExpress.XtraEditors.SimpleButton btnPrint; + private DevExpress.XtraEditors.SimpleButton btnReport; private DevExpress.XtraEditors.SimpleButton btnDesign; } } diff --git a/DevApp/Gs.DevApp/UserControl/UcBtnPrint.cs b/DevApp/Gs.DevApp/UserControl/UcBtnPrint.cs index 046441e..1196a45 100644 --- a/DevApp/Gs.DevApp/UserControl/UcBtnPrint.cs +++ b/DevApp/Gs.DevApp/UserControl/UcBtnPrint.cs @@ -1,4 +1,10 @@ -锘縰sing DevExpress.XtraEditors; +锘縰sing DevExpress.Utils.VisualEffects; +using DevExpress.XtraBars; +using DevExpress.XtraEditors; +using Gs.DevApp.DevFrm.Rpt; +using Gs.DevApp.DevFrm.Sys; +using Gs.DevApp.ToolBox; +using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel; @@ -16,6 +22,105 @@ public UcBtnPrint() { InitializeComponent(); + btnReport.Click += BtnReport_ItemClick; + btnDesign.Click += BtnDesign_ItemClick; + + } + /// <summary> + /// 鍏抽敭瀛楋紝涓�鑸槸涓婚敭 + /// </summary> + public string guidKey { get; set; } + /// <summary> + /// 鎶ヨ〃锛屽湪鏁版嵁搴撲腑瑕佸敮涓�,濡傦細瀛樺偍杩囩▼鍚峽鍏ュ弬1鍚峾鍏ュ弬鍊�,鍏ュ弬2鍚峾鍏ュ弬鍊紏 + /// </summary> + public string rptParameter { get; set; } + + + /// <summary> + /// 璁剧疆鎶ヨ〃 + /// </summary> + public event EventHandler btnDesignClick; + + /// <summary> + /// 鎶ヨ〃 + /// </summary> + public event EventHandler btnReportClick; + + private void BtnReport_ItemClick(object sender, EventArgs e) + { + if (btnReportClick != null) + btnReportClick(this, e); + else + return; + + if (rptParameter == "return false") + return; + if (string.IsNullOrEmpty(rptParameter)) + { + MsgHelper.ShowError("娌℃湁鎸囧畾鎶ヨ〃鍙傛暟锛岃鑱旂郴鎶�鏈紑鍙戜汉鍛橈紒"); + return; + } + var _bl = false; + _bl = _ckRptService(); + if (_bl) + { + var frm = new RptPreview(guidKey, rptParameter); + frm.ShowDialog(); + return; + } + + MsgHelper.ShowError("娌℃湁璁捐妯℃澘锛岃鍏堣璁℃ā鏉匡紒"); + } + + private void BtnDesign_ItemClick(object sender, EventArgs e) + { + if (btnDesignClick != null) + btnDesignClick(this, e); + else + return; + + if (string.IsNullOrEmpty(rptParameter)) + { + MsgHelper.ShowError("娌℃湁鎸囧畾鎶ヨ〃鍙傛暟锛岃鑱旂郴鎶�鏈紑鍙戜汉鍛橈紒"); + return; + } + var _bl = false; + _bl = _ckRptService(); + //濡傛灉宸茬粡鏈夋ā鏉夸簡锛岀洿鎺ユ墦寮�璁剧疆妯℃澘 + if (_bl) + { + var frm = new EasyRptDesign(guidKey, rptParameter); + frm.ShowDialog(); + return; + } + //鍚﹀垯鍚戝璁捐妯℃澘 + var rptWizard = new ShowRptWizard(guidKey, rptParameter); + rptWizard.ShowDialog(); + } + private bool _ckRptService() + { + try + { + var _obj = new + { + guid = guidKey, + rptParameter, + isDesign = 1 + }; + var strJson = UtilityHelper.HttpPost("", "Report/GetRptData", + JsonConvert.SerializeObject(_obj)); + var _rtn = UtilityHelper.ReturnToDynamic(strJson); + if (_rtn.rtnCode > 0) return true; + return false; + } + catch (Exception ex) + { + MsgHelper.Warning("鎻愮ず锛�" + ex.Message); + return true; + } + return false; + } + } } -- Gitblit v1.9.3