From 22752b5e9a5fb36d0647f56fb8f10806f637965c Mon Sep 17 00:00:00 2001 From: yangle <admin@YINMOU> Date: 星期五, 09 十二月 2022 18:00:39 +0800 Subject: [PATCH] 维护 --- WorkM/流转卡管理/MES_StationInBill.cs | 196 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 185 insertions(+), 11 deletions(-) diff --git "a/WorkM/\346\265\201\350\275\254\345\215\241\347\256\241\347\220\206/MES_StationInBill.cs" "b/WorkM/\346\265\201\350\275\254\345\215\241\347\256\241\347\220\206/MES_StationInBill.cs" index 845c5d3..e30106e 100644 --- "a/WorkM/\346\265\201\350\275\254\345\215\241\347\256\241\347\220\206/MES_StationInBill.cs" +++ "b/WorkM/\346\265\201\350\275\254\345\215\241\347\256\241\347\220\206/MES_StationInBill.cs" @@ -17,6 +17,7 @@ { InitializeComponent(); } + public DBUtility.frmBillQueryCondition_New frmCondition; public string ModName = "3790"; public string ModCaption = "杩涚珯鎺ユ敹鍗�"; public const string ModRightName = "MES_StationInBill"; @@ -30,8 +31,9 @@ public DAL.ClsSc_StationInBill BillNew = new DAL.ClsSc_StationInBill(); public DAL.ClsSc_StationInBill BillOld = new DAL.ClsSc_StationInBill(); - public Int64 lngBillKey; - public Int64 lngBillSubKey; + public Int64 HInterID;//涓诲唴鍚� + public Int64 lngBillKey; //娴佽浆鍗D + public Int64 lngBillSubKey; //娴佽浆鍗″瓙ID public Int64 lngICMOEntryID; //------------------------------------------------------------------------- @@ -42,7 +44,14 @@ public void Sub_ClearBill() { DBUtility.Xt_BaseBillFun.Sub_ClearBill(gbUp); + DBUtility.Xt_BaseBillFun.Sub_ClearBill1(tabPage1); + DBUtility.Xt_BaseBillFun.Sub_ClearBill1(tabPage2); initGrid(); + txtHBarCode.Text = ""; + txtHProcExchBillNo.Enabled = true; + txtHProcNo.Enabled = true; + txtHBarCode.Enabled = true; + tabControl1.SelectedIndex = 0; txtHBarCode.Focus(); //寰楀埌鎺ユ敹浜轰俊鎭紙杩涚珯鎺ユ敹浜洪粯璁や负鐧诲綍浜猴紝鏍规嵁鐧诲綍浜虹敤鎴峰悕锛屾壘鍒拌亴鍛樺悓鍚嶇殑璁板綍锛岄粯璁ゅ啓鍏� 鎺ユ敹浜� 鏂囨湰妗嗭紱濡傛灉娌℃壘鍒板垯涓虹┖锛涳級 DataSet Ds; @@ -67,6 +76,7 @@ DBUtility.Xt_BaseBillFun.initGridMESList(grdCardList, this.Name + "grdCardList"); DBUtility.Xt_BaseBillFun.initGridList(grdSub, this.Name); grdSub.SelectionMode = DataGridViewSelectionMode.CellSelect; + grdCardList.DataSource = null; } private void Display() @@ -129,6 +139,7 @@ //鍙栨秷鎸夐挳 private void cmdCancel_Click(object sender, EventArgs e) { + ClsPub.SaveGridView(grdSub, Name+"grdSub", ClsPub.AppPath);//璁剧疆鍒楀 this.Close(); } //鎺т欢浣嶇疆 @@ -142,6 +153,7 @@ //绐椾綋鍔犺浇 private void Sc_StationInBill_Load(object sender, EventArgs e) { + frmCondition = new DBUtility.frmBillQueryCondition_New(); //鎵撳嵃鍒濆鍖� this.Text = ModCaption; this.lblCaption.Text = ModCaption; @@ -169,7 +181,7 @@ private void Sc_StationInBill_FormClosing(object sender, FormClosingEventArgs e) { BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew; - //DBUtility.Xt_BaseBillFun.SaveGrid(grdMain, this.Name); + //DBUtility.Xt_BaseBillFun.SaveGrid(grdSub, this.Name); DBUtility.Xt_BaseBillFun.SaveGrid(grdCardList, this.Name + "grdCardList"); } //鏂板鍗曟嵁 @@ -183,11 +195,11 @@ this.txtHStationInTime.Text = DBUtility.ClsPub.GetServerDate(-1); this.txtHBillNo.Text = ClsPub.CreateBillCode(BillNew.BillType, ref ClsPub.sExeReturnInfo, true);//寰楀埌鏂板崟鍙� - - if (lngBillKey != 0 ) - { - //LotShow(); - } + this.HInterID = DBUtility.ClsPub.CreateBillID(this.ModName, ref DBUtility.ClsPub.sExeReturnInfo); + //if (lngBillKey != 0 ) + //{ + // //LotShow(); + //} } private void LotShow() //鑷姩杞藉叆 娴佽浆鍗¤繘绔欑晫闈㈠姛鑳� @@ -403,6 +415,13 @@ // txtHProcExchBillNo.Enabled = false; txtHProcNo.Enabled = false; + + //鍔犺浇 閰嶄欢缁戝畾娓呭崟 + HInterID = BillOld.omodel.HInterID; + DisplaySub(); + + + } //鍗曟嵁瀹屾暣鎬у垽鏂� 鏈畬鎴� @@ -547,10 +566,26 @@ return false; //璧嬪�糏D if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify) + { BillNew.omodel.HInterID = BillOld.omodel.HInterID; + } + else + { + BillNew.omodel.HInterID = HInterID; + } //涓荤被璧嬪�� - BillNew.omodel.HYear = 2011; - BillNew.omodel.HPeriod = 1; + //鍒ゆ柇浼氳鏈熸槸鍚﹀悎鐞� + string s = ""; + int sYear = 0; + int sPeriod = 0; + if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(DBUtility.ClsPub.isDate(this.txtHStationInTime.Text), ref sYear, ref sPeriod, ref s) == false) + { + MessageBox.Show(s, "鎻愮ず"); + return false; + } + // + BillNew.omodel.HYear = sYear; + BillNew.omodel.HPeriod = sPeriod; BillNew.omodel.HBillNo = this.txtHBillNo.Text.Trim(); BillNew.omodel.HICMOBillNo = this.txtHICMOBillNo.Text.Trim(); BillNew.omodel.HICMOInterID = DBUtility.ClsPub.isLong(this.txtHICMOBillNo.Tag); @@ -954,6 +989,7 @@ txtHGroupID.Tag = 0; txtHGroupName.Text = ""; } + txtHQty.Focus(); } } @@ -1008,7 +1044,17 @@ { Sub_WriteInForm_SM2(Ds.Tables[0], i); } - txtHQty.Focus(); + //濡傛灉绯荤粺鍙傛暟鍚敤浜� 杩涚珯鍗曠粦瀹氶厤浠舵竻鍗曞垯 浠庣敓浜х敤鏂欐竻鍗曚腑鑾峰彇宸ュ簭BOM鍐欏叆 涓存椂琛紝骞跺姞杞借〃鏍� + Pub_Class.ClsXt_SystemParameter oParam = new ClsXt_SystemParameter(); + string sIsBingLine = oParam.GetSingleSystemParameter("MES_StationInBill_LineBindCtl",ref DBUtility.ClsPub.sExeReturnInfo ); + if (sIsBingLine.Trim() == "Y") + { + oCn.RunProc("exec h_p_MES_StationInBillSubBindSource_Insert " + lngBillKey.ToString() + " , " + lngBillSubKey.ToString() + "," + HInterID.ToString() + " "); + //鍒锋柊琛ㄤ綋缃戞牸鏁版嵁 + DisplaySub(); + } + // + txtHGroupID.Focus(); } } @@ -1418,5 +1464,133 @@ { this.Sub_AddBill(); } + + //閰嶄欢鏉″舰鐮� 鍥炶溅浜嬩欢 + private void txtHBarCode_Mater_KeyDown(object sender, KeyEventArgs e) + { + try + { + if (e.KeyCode == Keys.Return) + { + if (txtHBarCode_Mater.Text.Trim() == "") + { + MessageBox.Show("璇疯緭鍏ユ潯褰㈢爜锛�"); + return; + } + string sBarCode = txtHBarCode_Mater.Text.Trim(); + txtHBarCode_Mater.Text = ""; + //鍒ゆ柇鏉″舰鐮佹槸鍚﹀湪鏉$爜妗f涓紝鍒ゆ柇鏉″舰鐮佹槸鍚﹀悎鐞� + //鍏堝垽鏂� 涓存椂琛ㄤ腑鏄惁鏈夋暟鎹紝鏉″舰鐮佺殑鐗╂枡鏄惁鍦ㄦ竻鍗曚腑锛屽啓鍏� 鎵爜璁板綍琛� + //寰楀埌淇℃伅 + SQLHelper.ClsCN oCn = new ClsCN(); + DataSet Ds; + Ds = oCn.RunProcReturn("exec h_p_MES_StationInBillSub_BindBarCode " + HInterID.ToString() + " ,'" + sBarCode + "'", "h_p_MES_StationInBillSub_BindBarCode"); + //鍐欏叆淇℃伅 + if (Ds == null || Ds.Tables[0].Rows.Count == 0) + { + MessageBox.Show("鏈煡璇㈠埌鏉″舰鐮佷俊鎭紒"); + return; + } + else if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0][0]) == 2) + { + MessageBox.Show("閿欒锛�" + DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0][1])); + return; + } + //鍒锋柊琛ㄤ綋缃戞牸鏁版嵁锛堟渶濂介鑹叉樉绀猴級 + DisplaySub(); + } + } + catch (Exception e1) + { + MessageBox.Show(e1.Message + "txtHBarCode_Mater_KeyDown"); + } + } + + private void DisplaySub() + { + try + { + SQLHelper.ClsCN oCn = new ClsCN(); + DataSet Dsplay; + Dsplay = oCn.RunProcReturn("exec h_p_MES_StationInBillSub_BindDisplay " + HInterID.ToString() + " ", "h_p_MES_StationInBillSub_BindDisplay"); + //鍐欏叆淇℃伅 + if (Dsplay == null ) + { + MessageBox.Show("鍒锋柊澶辫触锛�"); + return; + } + else if(Dsplay.Tables[0].Rows.Count == 0) + { + return; + } + else + { + //閲婃斁鍐荤粨 + DBUtility.Xt_BaseBillFun.CancelFrozenCol(grdSub); + // + grdSub.DataSource = Dsplay.Tables[0].DefaultView; + //璁剧疆鍚堣鍒� + //string sTotalCol = ""; + //sTotalCol = DBUtility.Gy_BaseFun.GetTotalCols(DSet); + //string[] sT; + //sT = sTotalCol.Split(Convert.ToChar(",")); + //oSumGrid.BuildTotalCols(sT); + // + //鍐荤粨 + int FrCol = DBUtility.ClsPub.isInt(frmCondition.txtFrozenCol.Text); + string s = frmCondition.cmbHComplete.Text; + DBUtility.Xt_BaseBillFun.DisplayGrid(grdSub, this.Name, s, FrCol); + //鐢荤嚎 + GraphLine(); + //鍐荤粨 + //int FrCol = 0; + //string s = "鏄�"; + //DBUtility.Xt_BaseBillFun.DisplayGrid(grdSub, this.Name + "grdSub", s, FrCol); + } + } + catch (Exception e) + { + MessageBox.Show(e.Message + "DisplaySub"); + } + } + private void GraphLine() + { + int MainIDCol = 0; + int SubIDCol = 0; + string s = frmCondition.cmbHComplete.Text; + long n = 0; + DBUtility.Xt_BaseBillFun.GraphLine(grdSub, MainIDCol, SubIDCol, s, ref n); + } + + private void cmdDelLine_Click(object sender, EventArgs e) + { + try + { + //鏍规嵁閫夋嫨鐨勬潯褰㈢爜 鏉ュ垹闄� + if (grdSub.CurrentRow == null) + return; + string sBarCode = DBUtility.ClsPub.isStrNull(grdSub.Rows[grdSub.CurrentRow.Index].Cells[Fun_GetCol("鏉″舰鐮�")].Value); + SQLHelper.ClsCN oCn = new ClsCN(); + oCn.RunProc(" delete from Sc_StationInBillSub_BindBarCodeTemp " + + "Where HInterID = "+ HInterID.ToString() +" and HBarCode = '"+ sBarCode + "'"); + DisplaySub(); + } + catch (Exception e1) + { + MessageBox.Show("鍒犻櫎琛屽け璐ワ紒"+e1.Message); + } + + } + + private void cmdHbclk_Click(object sender, EventArgs e) + { + //淇濆瓨鍒楀 + DBUtility.Xt_BaseBillFun.SaveGrid(grdSub, this.Name); + } + + private void cmdHmrlk_Click(object sender, EventArgs e) + { + DBUtility.Xt_BaseBillFun.DefaultGridView(grdSub, this.Name); + } } } \ No newline at end of file -- Gitblit v1.9.1