From 2993e61e9d1fbe09884f1ec42307f41df60192e0 Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期二, 24 十二月 2024 14:56:50 +0800 Subject: [PATCH] 细节修理 --- DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl.cs | 80 ++++++++++++++++++++++++++++----------- 1 files changed, 57 insertions(+), 23 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl.cs b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl.cs index b1de19b..2c84748 100644 --- a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl.cs +++ b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl.cs @@ -1,3 +1,4 @@ +using DevExpress.XtraGrid.Views.Base.ViewInfo; using Gs.DevApp.Entity; using Gs.DevApp.ToolBox; using Gs.DevApp.UserControl; @@ -27,8 +28,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) => { @@ -83,9 +84,45 @@ }; frm.ShowDialog(); }; - - gcMx1.MouseClick += GcMx1_MouseClick; + gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged; + 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) { _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns); @@ -565,26 +602,23 @@ } - - private void GcMx1_MouseClick(object sender, MouseEventArgs e) + private void GvMx1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) { - string rowGuid = Gs.DevApp.ToolBox.UtilityHelper.GetCurrentDoubleRow(gvMx1, e, "tlid"); - if (string.IsNullOrEmpty(rowGuid)) - return; - lbMxGuid.Text = rowGuid; - toolBarMenu1.guidKey = rowGuid; - var info = gvMx1.CalcHitInfo(e.Location); - var view = info.View; - var row = view.GetDataRow(info.RowHandle); - txtWlid.Text = row["tld002"].ToString(); - txtWlgg.Text = row["tld004"].ToString(); - txtWlmc.Text = row["tld003"].ToString(); - txtQuantity.Text = row["tld004"].ToString();//鐢宠鎬婚噺 - //txtYdy.Text = row["YDYNUM"].ToString();//宸叉墦鍗版�婚噺 - //kyPrtQty.Text = row["KDYNUM"].ToString();//鍙墦鍗版�婚噺 - - txtYdy.Text ="";//宸叉墦鍗版�婚噺 - kyPrtQty.Text ="";//鍙墦鍗版�婚噺 + if (e.FocusedRowHandle >= 0) + { + DataRow row = gvMx1.GetDataRow(e.FocusedRowHandle); + lbMxGuid.Text = row["tlid"].ToString(); + toolBarMenu1.guidKey = row["tlid"].ToString(); + txtWlid.Text = row["tld002"].ToString(); + txtWlgg.Text = row["tld004"].ToString(); + txtWlmc.Text = row["tld003"].ToString(); + txtQuantity.Text = row["tld004"].ToString();//鐢宠鎬婚噺 + //txtYdy.Text = row["YDYNUM"].ToString();//宸叉墦鍗版�婚噺 + //kyPrtQty.Text = row["KDYNUM"].ToString();//鍙墦鍗版�婚噺 + txtYdy.Text = "";//宸叉墦鍗版�婚噺 + kyPrtQty.Text = "";//鍙墦鍗版�婚噺 + } } + } } \ No newline at end of file -- Gitblit v1.9.3