| | |
| | | public const Int16 HQtyCol = 22; |
| | | public const Int16 HMinQtyCol = 23; |
| | | public const Int16 HBQtyCol = 24; |
| | | public const Int16 HDeptIDCol = 25; |
| | | public const Int16 HDeptNumberCol = 26; |
| | | public const Int16 HDeptNameCol = 27; |
| | | public const Int16 HSourceIDCol = 28; |
| | | public const Int16 HSourceNumberCol = 29; |
| | | public const Int16 HSourceNameCol = 30; |
| | | public const Int16 HDateCol = 31; |
| | | public const Int16 HEndDateCol = 32; |
| | | public const Int16 HSupIDCol = 33; |
| | | public const Int16 HSupNumberCol = 34; |
| | | public const Int16 HSupNameCol = 35; |
| | | public const Int16 HCusIDCol = 36; |
| | | public const Int16 HCusNumberCol = 37; |
| | | public const Int16 HCusNameCol = 38; |
| | | public const Int16 HCusTypeCol = 39; |
| | | public const Int16 HSourceInterIDCol = 40; |
| | | public const Int16 HSourceEntryIDCol = 41; |
| | | public const Int16 HSourceBillNoCol = 42; |
| | | public const Int16 HSourceBillTypeCol = 43; |
| | | public const Int16 HInstructIDCol = 44; |
| | | public const Int16 HInstructNoCol = 45; |
| | | public const Int16 HSeOrderBillIDCol = 46; |
| | | public const Int16 HSeOrderBillNoCol = 47; |
| | | public const Int16 HWhIDCol = 48; |
| | | public const Int16 HWhNumberCol = 49; |
| | | public const Int16 HWhNameCol = 50; |
| | | public const Int16 HSPIDCol = 51; |
| | | public const Int16 HSPNumberCol = 52; |
| | | public const Int16 HSPNameCol = 53; |
| | | public const Int16 HinitQtyCol = 54; |
| | | public const Int16 HRemarkCol = 55; |
| | | public const Int16 HPinfanBarCodeCol = 56; |
| | | public const Int16 HMTONoCol = 57; |
| | | public const Int16 HShowDateCol = 58; |
| | | public const Int16 HInnerBillNoCol = 59; |
| | | public const Int16 HMakerCol = 60; |
| | | public const Int16 HPackQtyCol = 25; |
| | | public const Int16 HDeptIDCol = 26; |
| | | public const Int16 HDeptNumberCol = 27; |
| | | public const Int16 HDeptNameCol = 28; |
| | | public const Int16 HSourceIDCol = 29; |
| | | public const Int16 HSourceNumberCol = 30; |
| | | public const Int16 HSourceNameCol = 31; |
| | | public const Int16 HDateCol = 32; |
| | | public const Int16 HEndDateCol = 33; |
| | | public const Int16 HSupIDCol = 34; |
| | | public const Int16 HSupNumberCol = 35; |
| | | public const Int16 HSupNameCol = 36; |
| | | public const Int16 HCusIDCol = 37; |
| | | public const Int16 HCusNumberCol = 38; |
| | | public const Int16 HCusNameCol = 39; |
| | | public const Int16 HCusTypeCol = 40; |
| | | public const Int16 HSourceInterIDCol = 41; |
| | | public const Int16 HSourceEntryIDCol = 42; |
| | | public const Int16 HSourceBillNoCol = 43; |
| | | public const Int16 HSourceBillTypeCol = 44; |
| | | public const Int16 HInstructIDCol = 45; |
| | | public const Int16 HInstructNoCol = 46; |
| | | public const Int16 HSeOrderBillIDCol = 47; |
| | | public const Int16 HSeOrderBillNoCol = 48; |
| | | public const Int16 HSeOrderSEQCol = 49; |
| | | public const Int16 HWhIDCol = 50; |
| | | public const Int16 HWhNumberCol = 51; |
| | | public const Int16 HWhNameCol = 52; |
| | | public const Int16 HSPIDCol = 53; |
| | | public const Int16 HSPNumberCol = 54; |
| | | public const Int16 HSPNameCol = 55; |
| | | public const Int16 HinitQtyCol = 56; |
| | | public const Int16 HRemarkCol = 57; |
| | | public const Int16 HPinfanBarCodeCol = 58; |
| | | public const Int16 HMTONoCol = 59; |
| | | public const Int16 HShowDateCol = 60; |
| | | public const Int16 HInnerBillNoCol = 61; |
| | | public const Int16 HMakerCol = 62; |
| | | |
| | | public Int16 HSelectCol = 0; |
| | | public Int16 HSno2Col = 1; |
| | |
| | | public Int16 HInstructNo2Col = 43; |
| | | public Int16 HSeOrderBillID2Col = 44; |
| | | public Int16 HSeOrderBillNo2Col = 45; |
| | | public Int16 HWhID2Col = 46; |
| | | public Int16 HWhNumber2Col = 47; |
| | | public Int16 HWhName2Col = 48; |
| | | public Int16 HSPID2Col = 49; |
| | | public Int16 HSPNumber2Col = 50; |
| | | public Int16 HSPName2Col = 51; |
| | | public Int16 HRemark2Col = 52; |
| | | public Int16 HPinfanBarCode2Col = 53; |
| | | public Int16 HMTONo2Col = 54; |
| | | public Int16 HShowDate2Col = 55; |
| | | public Int16 HInnerBillNo2Col = 56; |
| | | public Int16 HMaker2Col = 57; |
| | | public Int16 HSeOrderSEQ2Col = 46; |
| | | public Int16 HWhID2Col = 47; |
| | | public Int16 HWhNumber2Col = 48; |
| | | public Int16 HWhName2Col = 49; |
| | | public Int16 HSPID2Col = 50; |
| | | public Int16 HSPNumber2Col = 51; |
| | | public Int16 HSPName2Col = 52; |
| | | public Int16 HRemark2Col = 53; |
| | | public Int16 HPinfanBarCode2Col = 54; |
| | | public Int16 HMTONo2Col = 55; |
| | | public Int16 HShowDate2Col = 56; |
| | | public Int16 HInnerBillNo2Col = 57; |
| | | public Int16 HMaker2Col = 58; |
| | | public Int16 HEntryID2Col = 59; |
| | | // |
| | | public string ModName = "85"; |
| | | public string ModCaption = "æ¡ç çæ"; |
| | |
| | | public string ERPMode = ""; //ERP模å¼ï¼WISEãCLOUDï¼ |
| | | public string CampanyName = ""; //客æ·å®å¶ååç§° |
| | | public string SourceQtyCtl = ""; //è¶
æºåæ°éæ§å¶ |
| | | //------------------------------------------------------------------------- |
| | | public long PrintQty = 0; //å
许æ¡ç æå°æ¬¡æ° |
| | | public string PrintQtyCtl = ""; //æ¡ç æå°æ¬¡æ°æ§å¶ |
| | | public string UpdatePrintQtyCtl = ""; //æ¡ç æå°æ¬¡æ°æ´æ° |
| | | //------------------------------------------------------------------------- |
| | | #region åºå®ä»£ç |
| | | |
| | | //æ¸
空çé¢ |
| | |
| | | cmbSourceBillType.Items.Add("éè´è®¢å"); |
| | | cmbSourceBillType.Items.Add("æ¶æéç¥å"); |
| | | cmbSourceBillType.Items.Add("å§å¤è®¢å"); |
| | | cmbSourceBillType.Items.Add("å·¥åºæ±æ¥å"); |
| | | cmbSourceBillType.Items.Add("å·¥åºæµè½¬å¡"); |
| | | cmbSourceBillType.Items.Add("éè´§éç¥å"); |
| | | cmbSourceBillType.Items.Add("å
¶ä»å
¥åºå"); |
| | | cmbSourceBillType.Items.Add("ç´æ¥è°æ¨å"); |
| | |
| | | ERPMode = oSystemParameter.omodel.WMS_WMSStockCtl_ERPMode; |
| | | CampanyName = oSystemParameter.omodel.WMS_CampanyName; |
| | | SourceQtyCtl = oSystemParameter.omodel.BarCode_SourceQtyCtl; |
| | | PrintQty = oSystemParameter.omodel.BarCode_PrintQty; |
| | | PrintQtyCtl = oSystemParameter.omodel.BarCode_PrintQtyCtl; |
| | | UpdatePrintQtyCtl = oSystemParameter.omodel.BarCode_UpdatePrintQtyCtl; |
| | | } |
| | | |
| | | cmbHWorksNumber.Items.Clear(); |
| | |
| | | string HMaterNumber = ""; //ç©æä»£ç |
| | | double HSumQty = 0; //äº§åæ°é |
| | | double HMinQty = 0; //æå°å
è£
æ° |
| | | int HBQty = 0; //ç®±æ° |
| | | Int64 HBQty = 0; //ç®±æ° |
| | | double HQty = 0; //æ°é |
| | | string WeiShu = ""; //å°¾æ° |
| | | int LSH = 0; //æµæ°´å· |
| | | Int64 LSH = 0; //æµæ°´å· |
| | | string LSH2 = ""; //æµæ°´å·è½¬æ¢æå符 |
| | | string sDate = ""; //æ¥æ |
| | | string sYear = ""; //å¹´ |
| | |
| | | string HBarCodeBatchNo = ""; //æ¡ç æ¹æ¬¡å· |
| | | string HBarCodeDate = ""; //æ¡ç æ¥æ |
| | | int k = 0; |
| | | int n = 0; //å䏿¹çææ¡ç ä¸çç¬¬å æ¡ |
| | | Int64 n = 0; //å䏿¹çææ¡ç ä¸çç¬¬å æ¡ |
| | | string sTMNumber = ""; //æ¡ç èªå®ä¹åç¼ |
| | | DataSet Ds; |
| | | //Ds = oCn.RunProcReturn("exec GetLSH '" + ClsPub.GetServerDate(0) + "'", "GetLSH"); |
| | |
| | | sTMNumber = HNumber + sYear + sPeriod + sDay; |
| | | Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· |
| | | //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); |
| | | LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]); |
| | | LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); |
| | | } |
| | | else if (CampanyName == "é£é¾") |
| | | { |
| | |
| | | sTMNumber = HWorksNumber + HNumber + sYear + sPeriod + sDay; |
| | | Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· |
| | | //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); |
| | | LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]); |
| | | LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); |
| | | } |
| | | else //éç¨æ¹æ³ |
| | | { |
| | |
| | | sTMNumber = HOrgNumber + HNumber + sYear + sPeriod + sDay; |
| | | Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· |
| | | //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); |
| | | LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]); |
| | | LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); |
| | | } |
| | | } |
| | | else if (cmbHBarCodeType.Text == "åç§æ¡ç ") |
| | |
| | | { |
| | | TM = HOrgNumber + HNumber + HBatchNo; |
| | | }//åæ¥ç¹æ®å¤ç |
| | | else if (cmbHBarCodeType.Text == "åºåç ") |
| | | { |
| | | //æ¡ç è§åï¼ GX+ç©æå
ç +å¹´å¹´æææ¥æ¥+5使µæ°´å· |
| | | LSHlen = 5; |
| | | //æ¡ç åç¼ = GX+ç©æå
ç +å¹´å¹´æææ¥æ¥ |
| | | sTMNumber = "GX" + HNumber + sYear + sPeriod + sDay; |
| | | Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· |
| | | LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); |
| | | } |
| | | else if(cmbHBarCodeType.Text == "仪å¨å¤è´ä»¶æ¡ç æ®éè§å" || cmbHBarCodeType.Text == "仪å¨å¤è´ä»¶æ¡ç 容å¨è§å") |
| | | { |
| | | //ç©æç¼ç +åæ®æ¥æï¼YYMMDDï¼+æµæ°´4ä½ |
| | | sTMNumber = HMaterNumber + sYear + sPeriod + sDay; |
| | | Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· |
| | | //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); |
| | | LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]); |
| | | LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); |
| | | LSHlen = 4; |
| | | } |
| | | else if (cmbHBarCodeType.Text == "ä»ªå¨æåæ¡ç è§å") //å¦å¤å¤çäº |
| | |
| | | //sTMNumber = HMaterNumber + sYear + sPeriod + sDay; |
| | | //Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· |
| | | // //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); |
| | | //LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]); |
| | | //LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); |
| | | } |
| | | else if (cmbHBarCodeType.Text == "è¯åæåæ¡ç è§å") |
| | | { |
| | |
| | | sTMNumber = HMaterNumber + HBatchNo ; |
| | | Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· |
| | | //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); |
| | | LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]); |
| | | LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); |
| | | LSHlen = 6; |
| | | } |
| | | else if (cmbHBarCodeType.Text == "å
éæºæ¡ç ") |
| | |
| | | sTMNumber = "1" + HModelName + HBarCodeDate + HBarCodeBatchNo + HYasuoji + "00" ; |
| | | Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· |
| | | //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); |
| | | LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]); |
| | | LSHlen = 5; |
| | | if (sTMNumber.Length != 16) |
| | | LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); |
| | | LSHlen = 4; |
| | | if (sTMNumber.Length != 16 && sTMNumber.Length != 15) |
| | | { |
| | | MessageBox.Show("æ¡ç é¿åº¦ä¸å¤16ä½ï¼æ¯å¦æ°æ®ä¸å
¨ï¼å¶é æ¬é¨1ä½:[0] + æºå代ç 5ä½:[" + HModelName + "] + å¹´ææ¥5ä½:["+ HBarCodeDate + "] + æ¹æ¬¡å·2ä½:[" + HBarCodeBatchNo + "]+ å缩æº1ä½:["+ HYasuoji + "]+00 ; "); |
| | | MessageBox.Show("æ¡ç é¿åº¦ä¸å¤15æ16ä½ï¼æ¯å¦æ°æ®ä¸å
¨ï¼å¶é æ¬é¨1ä½:[0] + æºå代ç 5ä½:[" + HModelName + "] + å¹´ææ¥4æ5ä½:["+ HBarCodeDate + "] + æ¹æ¬¡å·2ä½:[" + HBarCodeBatchNo + "]+ å缩æº1ä½:["+ HYasuoji + "]+00 ; "); |
| | | return; |
| | | } |
| | | } |
| | |
| | | sTMNumber = HMaterNumber.Replace( "." , "" ) + HBarCodeDate + HBarCodeBatchNo; |
| | | Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· |
| | | //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); |
| | | LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]); |
| | | LSHlen = 5; |
| | | if (sTMNumber.Length != 18) |
| | | LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); |
| | | LSHlen = 4; |
| | | if (sTMNumber.Length != 18 && sTMNumber.Length != 17) |
| | | { |
| | | MessageBox.Show("æ¡ç é¿åº¦ä¸å¤18ä½ï¼æ¯å¦æ°æ®ä¸å
¨ï¼ç©æä»£ç 11ä½:["+ HMaterNumber.Replace(".", "") + "]+å¹´ææ¥5ä½:["+ HBarCodeDate + "]+æ¹æ¬¡å·2ä½:[" + HBarCodeBatchNo + "];"); |
| | | MessageBox.Show("æ¡ç é¿åº¦ä¸å¤17æ18ä½ï¼æ¯å¦æ°æ®ä¸å
¨ï¼ç©æä»£ç 11ä½:["+ HMaterNumber.Replace(".", "") + "]+å¹´ææ¥4æ5ä½:["+ HBarCodeDate + "]+æ¹æ¬¡å·2ä½:[" + HBarCodeBatchNo + "];"); |
| | | return; |
| | | } |
| | | } |
| | |
| | | sTMNumber = HICMOBillNo; |
| | | Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· |
| | | //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); |
| | | LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]); |
| | | LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); |
| | | LSHlen = 5; |
| | | } |
| | | //else if (cmbHBarCodeType.Text == "æçæ¡ç ") |
| | |
| | | return; |
| | | } |
| | | |
| | | HBQty = HBQty + ClsPub.isInt(grdMain.Rows[j].Cells[HBQtyCol].Value); |
| | | HBQty = HBQty + ClsPub.isLong(grdMain.Rows[j].Cells[HBQtyCol].Value); |
| | | HMinQty = ClsPub.isDoule(grdMain.Rows[j].Cells[HMinQtyCol].Value); |
| | | HSumQty = ClsPub.isDoule(grdMain.Rows[j].Cells[HQtyCol].Value); |
| | | n = 0; |
| | | int nn = 0; |
| | | for (int i = k; i < HBQty; i++) |
| | | { |
| | | if (HSumQty - HMinQty > 0) |
| | |
| | | //æ¡ç ç¼å· = æ¡ç åç¼ + æµæ°´å· |
| | | TM = sTMNumber + LSH2; |
| | | } |
| | | else if (cmbHBarCodeType.Text == "åºåç ") |
| | | { |
| | | //æ¡ç ç¼å· = æ¡ç åç¼ + æµæ°´å· |
| | | TM = sTMNumber + LSH2; |
| | | } |
| | | else if(cmbHBarCodeType.Text == "仪å¨å¤è´ä»¶æ¡ç æ®éè§å" || cmbHBarCodeType.Text == "仪å¨å¤è´ä»¶æ¡ç 容å¨è§å" || cmbHBarCodeType.Text == "è¯åæåæ¡ç è§å" |
| | | || cmbHBarCodeType.Text == "åæåæ¡ç " || cmbHBarCodeType.Text == "å¤éæºæ¡ç ") |
| | | { |
| | |
| | | return; |
| | | } |
| | | grdSub.Rows[i].Cells[HTMCol].Value = TM; |
| | | grdSub.Rows[i].Cells[HEntryID2Col].Value = j + 1; |
| | | grdSub.Rows[i].Cells[HMaterID2Col].Value = grdMain.Rows[j].Cells[HMaterIDCol].Value; |
| | | grdSub.Rows[i].Cells[HMaterNumber2Col].Value = grdMain.Rows[j].Cells[HMaterNumberCol].Value; |
| | | grdSub.Rows[i].Cells[HMaterName2Col].Value = grdMain.Rows[j].Cells[HMaterNameCol].Value; |
| | |
| | | grdSub.Rows[i].Cells[HSourceName2Col].Value = grdMain.Rows[j].Cells[HSourceNameCol].Value; |
| | | grdSub.Rows[i].Cells[HEndDate2Col].Value = grdMain.Rows[j].Cells[HEndDateCol].Value; |
| | | grdSub.Rows[i].Cells[HSeOrderBillNo2Col].Value = grdMain.Rows[j].Cells[HSeOrderBillNoCol].Value; |
| | | grdSub.Rows[i].Cells[HSeOrderSEQ2Col].Value = grdMain.Rows[j].Cells[HSeOrderSEQCol].Value; |
| | | grdSub.Rows[i].Cells[HInnerBillNo2Col].Value = grdMain.Rows[j].Cells[HInnerBillNoCol].Value; |
| | | grdSub.Rows[i].Cells[HMaker2Col].Value = grdMain.Rows[j].Cells[HMakerCol].Value; |
| | | grdSub.Rows[i].Cells[HGiveAwayFlag2Col].Value = grdMain.Rows[j].Cells[HGiveAwayFlagCol].Value; |
| | |
| | | grdSub.Rows[i].Cells[HGiveAwayFlag2Col] = oCell; |
| | | k = k + 1; |
| | | n = n + 1; |
| | | oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); |
| | | //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); |
| | | nn = nn + 1; |
| | | } |
| | | //åå°æ¹éæ§è¡è¯å¥ |
| | | oCn.RunProc("exec h_p_WMS_SetMaxNo_QTY '" + sTMNumber + "'," + nn.ToString() + " "); |
| | | } |
| | | } |
| | | string HWei = ""; //å°¾æ° |
| | |
| | | DateTime HEndDate; |
| | | string HWorkLineName = ""; |
| | | string HSeOrderBillNo = ""; |
| | | Int64 HSeOrderSEQ = 0; |
| | | string HInnerBillNo = ""; |
| | | bool HGiveAwayFlag = false; |
| | | Int64 HEntryID = 0; |
| | | try |
| | | { |
| | | oCn.BeginTran(); |
| | |
| | | } |
| | | // |
| | | HMaterID = ClsPub.isLong(grdSub.Rows[i].Cells[HMaterID2Col].Value); |
| | | HEntryID = ClsPub.isLong(grdSub.Rows[i].Cells[HEntryID2Col].Value); |
| | | HAuxPropID = ClsPub.isLong(grdSub.Rows[i].Cells[HAuxPropID2Col].Value); |
| | | HUnitID = ClsPub.isLong(grdSub.Rows[i].Cells[HUnitID2Col].Value); |
| | | HQty2 = ClsPub.isDoule(grdSub.Rows[i].Cells[HQty2Col].Value); |
| | |
| | | HEndDate = ClsPub.isDate(grdSub.Rows[i].Cells[HEndDate2Col].Value); |
| | | HWorkLineName = ClsPub.isStrNull(grdSub.Rows[i].Cells[HSourceName2Col].Value); |
| | | HSeOrderBillNo = ClsPub.isStrNull(grdSub.Rows[i].Cells[HSeOrderBillNo2Col].Value); |
| | | HSeOrderSEQ = ClsPub.isLong(grdSub.Rows[i].Cells[HSeOrderSEQ2Col].Value); |
| | | HInnerBillNo = ClsPub.isStrNull(grdSub.Rows[i].Cells[HInnerBillNo2Col].Value); |
| | | HGiveAwayFlag = ClsPub.isBool(grdSub.Rows[i].Cells[HGiveAwayFlag2Col].Value); |
| | | oCn.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" + |
| | |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " + |
| | | ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " + |
| | | ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate " + |
| | | ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID " + |
| | | ",HGiveAwayFlag " + |
| | | ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " + |
| | | ",HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID " + |
| | | ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo " + |
| | | ") values (" |
| | | + "'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString() |
| | |
| | | + ", " + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HWei + "'" |
| | | + ", " + HBarcodeQtys.ToString() + "," + HBarcodeNo.ToString() + "," + HDeptID.ToString() + "," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HRemark + "'" |
| | | + ", " + HCusID.ToString() + ",'" + HCusType + "','" + HEndDate.ToShortDateString() + "','" + HWorkLineName + "','" + sDate + "'" |
| | | + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",'" + HSeOrderBillNo + "'," + HInterID.ToString() |
| | | + ", " + DBUtility.ClsPub.BoolToString(HGiveAwayFlag) |
| | | + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",'" + HSeOrderBillNo + "'," + HInterID.ToString() + "," + HEntryID.ToString() + "" |
| | | + ", " + DBUtility.ClsPub.BoolToString(HGiveAwayFlag) + "," + HSeOrderSEQ.ToString() + "," + HSourceEntryID.ToString() |
| | | + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HInnerBillNo + "')"); |
| | | |
| | | |
| | |
| | | string HMaterNumber = ""; //ç©æä»£ç |
| | | double HSumQty = 0; //äº§åæ°é |
| | | double HMinQty = 0; //æå°å
è£
æ° |
| | | int HBQty = 0; //ç®±æ° |
| | | Int64 HBQty = 0; //ç®±æ° |
| | | double HQty = 0; //æ°é |
| | | string WeiShu = ""; //å°¾æ° |
| | | //int LSH = 0; //æµæ°´å· |
| | |
| | | // return; |
| | | //} |
| | | |
| | | HBQty = HBQty + ClsPub.isInt(grdMain.Rows[j].Cells[HBQtyCol].Value); |
| | | HBQty = HBQty + ClsPub.isLong(grdMain.Rows[j].Cells[HBQtyCol].Value); |
| | | HMinQty = ClsPub.isDoule(grdMain.Rows[j].Cells[HMinQtyCol].Value); |
| | | HSumQty = ClsPub.isDoule(grdMain.Rows[j].Cells[HQtyCol].Value); |
| | | n = 0; |
| | |
| | | // |
| | | grdMain.RowCount = 0; |
| | | grdSub.RowCount = 0; |
| | | grdMain.ColumnCount = 61; //æ»åæ° |
| | | grdMain.ColumnCount = 63; //æ»åæ° |
| | | DBUtility.Xt_BaseBillFun.initGridFst(grdMain, this.Name); |
| | | grdMain.Columns[HSnoCol].HeaderText = "åºå·"; |
| | | grdMain.Columns[HMainIDCol].HeaderText = "æºå主ID"; |
| | |
| | | grdMain.Columns[HGiveAwayFlagCol].HeaderText = "æ¯å¦èµ å"; |
| | | grdMain.Columns[HQtyCol].HeaderText = "æ°é"; |
| | | grdMain.Columns[HMinQtyCol].HeaderText = "æå°å
è£
æ°"; |
| | | grdMain.Columns[HPackQtyCol].HeaderText = "å¤ç®±æ°"; |
| | | grdMain.Columns[HBQtyCol].HeaderText = "ç®±æ°"; |
| | | grdMain.Columns[HSupIDCol].HeaderText = "ä¾åºåID"; |
| | | grdMain.Columns[HSupNumberCol].HeaderText = "ä¾åºå代ç "; |
| | |
| | | grdMain.Columns[HSPNameCol].HeaderText = "ä»ä½"; |
| | | grdMain.Columns[HInstructNoCol].HeaderText = "æä»¤åå·"; |
| | | grdMain.Columns[HSeOrderBillNoCol].HeaderText = "éå®è®¢åå·"; |
| | | grdMain.Columns[HSeOrderSEQCol].HeaderText = "éå®è®¢åè¡å·"; |
| | | grdMain.Columns[HDateCol].HeaderText = "è¿ææ¥æ"; |
| | | grdMain.Columns[HRemarkCol].HeaderText = "夿³¨"; |
| | | grdMain.Columns[HMTONoCol].HeaderText = "计åè·è¸ªå·"; |
| | |
| | | "," + HSeOrderBillNoCol.ToString() + |
| | | "," + HBatchNoCol.ToString() + |
| | | "," + HCusNumberCol.ToString() + |
| | | "," + HPackQtyCol.ToString() + |
| | | "," + HRemarkCol.ToString(); |
| | | //设置å计å |
| | | string sTotalCol = HQtyCol.ToString(); |
| | |
| | | DBUtility.Xt_BaseBillFun.initGridLast(sAllowCol, sTotalCol,oSumGrid); |
| | | //---------------------------- |
| | | |
| | | grdSub.ColumnCount = 58; //æ»åæ° |
| | | grdSub.ColumnCount = 60; //æ»åæ° |
| | | DBUtility.Xt_BaseBillFun.initGridFst(grdSub, this.Name); |
| | | grdSub.Columns[HSelectCol].HeaderText = "éæ©"; |
| | | grdSub.Columns[HTMCol].HeaderText = "æ¡ç ç¼å·"; |
| | |
| | | grdSub.Columns[HSourceBillNo2Col].HeaderText = "æºååå·"; |
| | | grdSub.Columns[HSourceBillType2Col].HeaderText = "æºåç±»å"; |
| | | grdSub.Columns[HSeOrderBillNo2Col].HeaderText = "éå®è®¢åå·"; |
| | | grdSub.Columns[HSeOrderSEQ2Col].HeaderText = "éå®è®¢åè¡å·"; |
| | | grdSub.Columns[HBarcodeNoCol].HeaderText = "æå·"; |
| | | grdSub.Columns[HBarcodeQtysCol].HeaderText = "æ»ææ°"; |
| | | grdSub.Columns[HSupID2Col].HeaderText = "ä¾åºåID"; |
| | |
| | | grdSub.Columns[HShowDate2Col].HeaderText = "æ¥æ"; |
| | | grdSub.Columns[HInnerBillNo2Col].HeaderText = "å
é¨éè´è®¢åå·"; |
| | | grdSub.Columns[HMaker2Col].HeaderText = "å¶å人"; |
| | | grdSub.Columns[HEntryID2Col].HeaderText = "è¡å·"; |
| | | //æ ¼å¼å |
| | | grdSub.Columns[HMaterID2Col].Visible = false; |
| | | grdSub.Columns[HModel2Col].Visible = false; |
| | |
| | | FillSelectData(oIF_PackageDismantleBillList.oBillSelectColl); |
| | | } |
| | | } |
| | | else if (cmbSourceBillType.Text.Trim() == "å·¥åºæµè½¬å¡") |
| | | { |
| | | string sWhere = " and HOrgID =" + HOrgID.ToString(); |
| | | DAL.Cls_S_IF_ProcessExchangeBillList oIF_ProcessExchangeBillList = new DAL.Cls_S_IF_ProcessExchangeBillList(); |
| | | if (oIF_ProcessExchangeBillList.Refresh(sWhere)) //éæ©åå |
| | | { |
| | | FillSelectData(oIF_ProcessExchangeBillList.oBillSelectColl); |
| | | } |
| | | } |
| | | else if (cmbSourceBillType.Text.Trim() == "å·¥åºæ±æ¥å") |
| | | { |
| | | string sWhere = " and HOrgID =" + HOrgID.ToString(); |
| | | DAL.Cls_S_IF_ProcessReportBillList oIF_ProcessReportBillList = new DAL.Cls_S_IF_ProcessReportBillList(); |
| | | if (oIF_ProcessReportBillList.Refresh(sWhere)) //éæ©åå |
| | | { |
| | | FillSelectData(oIF_ProcessReportBillList.oBillSelectColl); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | |
| | |
| | | //åå
¥ä¿¡æ¯ |
| | | Sub_WriteInForm1(Ds.Tables[0], i); |
| | | } |
| | | //å·¥åºæµè½¬å¡ |
| | | if (oSelectRow.BillType == "3772") |
| | | { |
| | | grdMain.Rows.Add(); |
| | | grdMain.Rows[i].Cells[HTagCol].Value = "*"; |
| | | //å¾å°ä¿¡æ¯ |
| | | Ds = oCn.RunProcReturn("select * from h_v_IF_ProcessExchangeList where hmainid=" + oSelectRow.BillMainID + " and hsubid=" + oSelectRow.BillSubID, "h_v_IF_ProcessExchangeList"); |
| | | //åå
¥ä¿¡æ¯ |
| | | Sub_WriteInForm1(Ds.Tables[0], i); |
| | | } |
| | | //çäº§æ±æ¥å |
| | | if (oSelectRow.BillType == "3714") |
| | | { |
| | | grdMain.Rows.Add(); |
| | | grdMain.Rows[i].Cells[HTagCol].Value = "*"; |
| | | //å¾å°ä¿¡æ¯ |
| | | Ds = oCn.RunProcReturn("select * from h_v_IF_ProcessReportList where hmainid=" + oSelectRow.BillMainID + " and hsubid=" + oSelectRow.BillSubID, "h_v_IF_ProcessReportList"); |
| | | //åå
¥ä¿¡æ¯ |
| | | Sub_WriteInForm1(Ds.Tables[0], i); |
| | | } |
| | | //峿¶åºå |
| | | if (oSelectRow.BillType == "JSKC") |
| | | { |
| | |
| | | "," + HMinQtyCol.ToString() + |
| | | "," + HAuxPropNumberCol.ToString() + |
| | | "," + HBatchNoCol.ToString() + |
| | | "," + HPackQtyCol.ToString() + |
| | | "," + HRemarkCol.ToString(); |
| | | grdMain.Columns[HBillNoCol].ReadOnly = true; |
| | | //设置å计å |
| | |
| | | { |
| | | grdMain.Rows[i].Cells[HGiveAwayFlagCol].Value = 0; |
| | | } |
| | | grdMain.Rows[i].Cells[HSeOrderBillNoCol].Value = oTable.Rows[0]["éå®è®¢åå·"].ToString(); |
| | | grdMain.Rows[i].Cells[HSeOrderSEQCol].Value = oTable.Rows[0]["éå®è®¢åè¡å·"].ToString(); |
| | | } |
| | | |
| | | } |
| | |
| | | #region //æå°è®¾ç½® |
| | | |
| | | GridppReport Report; |
| | | int CurRows = 0; |
| | | string sBarCodeItemID = ""; //æ¡ç èªå¢å |
| | | |
| | | //é¢è§ |
| | | int CurRows = 0; |
| | | private void yl_Click(object sender, EventArgs e) |
| | | { |
| | | //夿æ¯å¦å·²ç»çææ¡ç |
| | |
| | | } |
| | | } |
| | | |
| | | //æå°å夿æ¡ç æ¯å¦å·²æå°è¿ |
| | | //æå° |
| | | private void dy_Click(object sender, EventArgs e) |
| | | { |
| | | //夿æ¯å¦å·²ç»çææ¡ç |
| | | if (DBUtility.ClsPub.isStrNull(grdSub.Rows[0].Cells[HTMCol].Value) == "") |
| | | { |
| | | MessageBox.Show("æ¡ç æªçæï¼è¯·å
çææ¡ç ååæå°ï¼"); |
| | | return; |
| | | } |
| | | |
| | | //æå°å夿æ¡ç æ¯å¦å·²æå°è¿ |
| | | if (ReportPrintBegin()) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | //éæ©æå°æ¨¡æ¿ |
| | | BLL.Gy_OpenTmp oFrm = new BLL.Gy_OpenTmp(); |
| | | oFrm.sBillName = ModName; |
| | | oFrm.sBillModel = ModCaption; |
| | | oFrm.ShowDialog(); |
| | | if (oFrm.OKTag == Pub_Class.ClsPub.Enum_OKTag.OKTag_OK) |
| | | { |
| | | //循ç¯éä¸è¡ |
| | | Sub_SetReport(oFrm.sOpenTmp); |
| | | Report.Print(true); |
| | | Thread.Sleep(1000); |
| | | } |
| | | } |
| | | |
| | | ////æå°å夿æ¡ç æ¯å¦å·²æå°è¿ |
| | | //private bool ReportPrintBegin() |
| | | //{ |
| | | // string sRelQty = ""; |
| | | |
| | | // if (oBar.Set_BPrintQty(DBUtility.ClsPub.isStrNull(grdSub.Rows[0].Cells[HTMCol].Value), ref sRelQty)) |
| | | // { |
| | | // MessageBox.Show("æ¡ç å·²ç»æå°è¿ï¼ä¸å¯é夿å°ï¼"); |
| | | // return true; |
| | | // } |
| | | // else |
| | | // { |
| | | // return false; |
| | | // } |
| | | //} |
| | | |
| | | //æå°å夿æ¡ç æ¯å¦è¶
è¿å
è®¸å¯æå°æ¬¡æ° |
| | | private bool ReportPrintBegin() |
| | | { |
| | | string sRelQty = ""; |
| | | |
| | | if (oBar.Set_BPrintQty(DBUtility.ClsPub.isStrNull(grdSub.Rows[0].Cells[HTMCol].Value), ref sRelQty)) |
| | | string sHRemark = ""; |
| | | if (PrintQtyCtl == "Y") |
| | | { |
| | | MessageBox.Show("æ¡ç å·²ç»æå°è¿ï¼ä¸å¯é夿å°ï¼"); |
| | | return true; |
| | | if (oBar.Set_CheckPrintQty_SD(HInterID, PrintQty, ref sHRemark)) |
| | | { |
| | | MessageBox.Show(sHRemark); |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | //æå°ç»æååå¡«æ¡ç æå°æ¬¡æ° |
| | | private void ReportPrintEnd() |
| | | { |
| | | try |
| | | { |
| | | oCn.RunProc("update Gy_BarCodeBill set HPrintQty=isnull(HPrintQty,0)+1 where HInterID=" + HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | MessageBox.Show("æå°å¤±è´¥!æå°ç»æ ï¼" + e.Message); |
| | | } |
| | | } |
| | | |
| | |
| | | for (int i = 0; i < grdList.Rows.Count; i++) |
| | | { |
| | | grdList.Rows[i].Cells[0].Value = "*"; |
| | | } |
| | | // |
| | | Report = new GridppReport(); |
| | | Report.LoadFromFile(DBUtility.ClsPub.AppPath + @"\" + sOpenTmp + ".grf"); //here . |
| | | Report.BeforePostRecord += new _IGridppReportEvents_BeforePostRecordEventHandler(ReportBeforePostRecord); |
| | | Report.FetchRecord += new _IGridppReportEvents_FetchRecordEventHandler(ReportFetchRecordByDataTable); |
| | | Report.PrintEnd += new _IGridppReportEvents_PrintEndEventHandler(ReportPrintEnd); |
| | | } |
| | | |
| | | |
| | | private void Sub_SetReportView(string sOpenTmp) |
| | | { |
| | | //å¤æè¡æ° |
| | | for (int i = 0; i < grdList.Rows.Count; i++) |
| | | { |
| | | grdList.Rows[i].Cells[0].Value = ""; |
| | | } |
| | | for (int i = 0; i < grdList.SelectedRows.Count; i++) |
| | | { |
| | | grdList.Rows[grdList.SelectedRows[i].Index].Cells[0].Value = "*"; |
| | | } |
| | | // |
| | | Report = new GridppReport(); |
| | |
| | | } |
| | | } |
| | | |
| | | private Int32 Fun_GetCol(string sCol) |
| | | { |
| | | return DBUtility.Xt_BaseBillFun.Fun_GetCol(sCol, grdList); |
| | | } |
| | | |
| | | //å¡«å
¥åæ®è¡¨ä½ä¿¡æ¯ |
| | | private void ReportFetchRecordByDataTable() |
| | | { |
| | | try |
| | |
| | | } |
| | | } |
| | | |
| | | private void dy_Click(object sender, EventArgs e) |
| | | ////æå°ç»æååå¡«æ¡ç æå°æ¬¡æ° |
| | | //private void ReportPrintEnd() |
| | | //{ |
| | | // try |
| | | // { |
| | | // oCn.RunProc("update Gy_BarCodeBill set HPrintQty=isnull(HPrintQty,0)+1 where HInterID=" + HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | // } |
| | | // catch (Exception e) |
| | | // { |
| | | // MessageBox.Show("æå°å¤±è´¥!æå°ç»æ ï¼" + e.Message); |
| | | // } |
| | | //} |
| | | |
| | | //æå°ç»æååå¡«æ¡ç æå°æ¬¡æ° |
| | | private void ReportPrintEnd() |
| | | { |
| | | if (UpdatePrintQtyCtl == "Y") |
| | | { |
| | | oBar.Set_UpdatePrintQty_SD(HInterID); |
| | | } |
| | | } |
| | | |
| | | //è¯æå° |
| | | private void sdy_Click(object sender, EventArgs e) |
| | | { |
| | | //夿æ¯å¦å·²ç»çææ¡ç |
| | | if (DBUtility.ClsPub.isStrNull(grdSub.Rows[0].Cells[HTMCol].Value) == "") |
| | | { |
| | | MessageBox.Show("æ¡ç æªçæï¼è¯·å
çææ¡ç ååæå°ï¼"); |
| | | MessageBox.Show("æ¡ç æªçæï¼è¯·å
çææ¡ç ååé¢è§ï¼"); |
| | | return; |
| | | } |
| | | |
| | | //æå°å夿æ¡ç æ¯å¦å·²æå°è¿ |
| | | if (ReportPrintBegin()) |
| | | if (ReportPrintBegin_SDY()) |
| | | { |
| | | return; |
| | | } |
| | |
| | | oFrm.ShowDialog(); |
| | | if (oFrm.OKTag == Pub_Class.ClsPub.Enum_OKTag.OKTag_OK) |
| | | { |
| | | //循ç¯éä¸è¡ |
| | | Sub_SetReport(oFrm.sOpenTmp); |
| | | Report.Print(true); |
| | | Sub_SetReportView(oFrm.sOpenTmp); |
| | | Report.PrintPreview(false); |
| | | Thread.Sleep(1000); |
| | | } |
| | | } |
| | | |
| | | //æå°å夿æ¡ç æ¯å¦è¶
è¿å
è®¸å¯æå°æ¬¡æ° |
| | | private bool ReportPrintBegin_SDY() |
| | | { |
| | | string sHRemark = ""; |
| | | sBarCodeItemID = ""; |
| | | for (int i = 0; i < grdList.SelectedRows.Count; i++) |
| | | { |
| | | sBarCodeItemID = sBarCodeItemID + "," + DBUtility.ClsPub.isLong(grdList.Rows[grdList.SelectedRows[i].Index].Cells[Fun_GetCol("HItemID")].Value).ToString(); |
| | | } |
| | | sBarCodeItemID = sBarCodeItemID.Remove(0, 1); |
| | | |
| | | if (PrintQtyCtl == "Y") |
| | | { |
| | | if (oBar.Set_CheckPrintQty(sBarCodeItemID, PrintQty, ref sHRemark)) |
| | | { |
| | | MessageBox.Show(sHRemark); |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | private void Sub_SetReportView(string sOpenTmp) |
| | | { |
| | | //å¤æè¡æ° |
| | | for (int i = 0; i < grdList.Rows.Count; i++) |
| | | { |
| | | grdList.Rows[i].Cells[0].Value = ""; |
| | | } |
| | | for (int i = 0; i < grdList.SelectedRows.Count; i++) |
| | | { |
| | | grdList.Rows[grdList.SelectedRows[i].Index].Cells[0].Value = "*"; |
| | | } |
| | | // |
| | | Report = new GridppReport(); |
| | | Report.LoadFromFile(DBUtility.ClsPub.AppPath + @"\" + sOpenTmp + ".grf"); //here . |
| | | Report.BeforePostRecord += new _IGridppReportEvents_BeforePostRecordEventHandler(ReportBeforePostRecord); |
| | | Report.FetchRecord += new _IGridppReportEvents_FetchRecordEventHandler(ReportFetchRecordByDataTable); |
| | | Report.PrintEnd += new _IGridppReportEvents_PrintEndEventHandler(ReportPrintEnd_SDY); |
| | | } |
| | | |
| | | //æå°ç»æååå¡«æ¡ç æå°æ¬¡æ° |
| | | private void ReportPrintEnd_SDY() |
| | | { |
| | | if (UpdatePrintQtyCtl == "Y") |
| | | { |
| | | oBar.Set_UpdatePrintQty(sBarCodeItemID); |
| | | } |
| | | } |
| | | |
| | | private Int32 Fun_GetCol(string sCol) |
| | | { |
| | | return DBUtility.Xt_BaseBillFun.Fun_GetCol(sCol, grdList); |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | |
| | | } |
| | | sWhere = " and HOrgID =" + sHOrgID.ToString(); |
| | | BLL.Cls_S_KF_ICInventoryList_IF oadd = new BLL.Cls_S_KF_ICInventoryList_IF(); |
| | | if (oadd.Refresh("")) //éæ©åå |
| | | if (oadd.Refresh(sWhere)) //éæ©åå |
| | | //if (oadd.Refresh(" and HErpClsID in (1,2,3) ")) //éæ©åå |
| | | { |
| | | FillSelectData(oadd.oBillSelectColl); |
| | |
| | | grdMain.Rows[row + r].Cells[HMTONoCol].Value = grdMain.Rows[row].Cells[HMTONoCol].Value; |
| | | grdMain.Rows[row + r].Cells[HInnerBillNoCol].Value = grdMain.Rows[row].Cells[HInnerBillNoCol].Value; |
| | | grdMain.Rows[row + r].Cells[HMakerCol].Value = grdMain.Rows[row].Cells[HMakerCol].Value; |
| | | //ç½æ ¼æå¾ |
| | | DataGridViewCheckBoxCell oCell = new DataGridViewCheckBoxCell(); |
| | | oCell.ThreeState = false; |
| | | oCell.Value = grdMain.Rows[row].Cells[HGiveAwayFlagCol].Value; |
| | | oCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; |
| | | grdMain.Rows[row + r].Cells[HGiveAwayFlagCol] = oCell; |
| | | |
| | | } |
| | | DBUtility.Xt_BaseBillFun.SetSumGrid(oSumGrid); |
| | |
| | | } |
| | | } |
| | | |
| | | private void sdy_Click(object sender, EventArgs e) |
| | | { |
| | | //夿æ¯å¦å·²ç»çææ¡ç |
| | | if (DBUtility.ClsPub.isStrNull(grdSub.Rows[0].Cells[HTMCol].Value) == "") |
| | | { |
| | | MessageBox.Show("æ¡ç æªçæï¼è¯·å
çææ¡ç ååé¢è§ï¼"); |
| | | return; |
| | | } |
| | | |
| | | //æå°å夿æ¡ç æ¯å¦å·²æå°è¿ |
| | | if (ReportPrintBegin()) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | //éæ©æå°æ¨¡æ¿ |
| | | BLL.Gy_OpenTmp oFrm = new BLL.Gy_OpenTmp(); |
| | | oFrm.sBillName = ModName; |
| | | oFrm.sBillModel = ModCaption; |
| | | oFrm.ShowDialog(); |
| | | if (oFrm.OKTag == Pub_Class.ClsPub.Enum_OKTag.OKTag_OK) |
| | | { |
| | | Sub_SetReportView(oFrm.sOpenTmp); |
| | | Report.PrintPreview(false); |
| | | Thread.Sleep(1000); |
| | | } |
| | | } |
| | | |
| | | //çæå¤ç®±ç |
| | | private void wxm_Click(object sender, EventArgs e) |
| | | { |
| | | //å¿
é¡»æ¡ç çææé®æ¯ç°åº¦æå¯ä»¥çæç®±æ¡ç |
| | | if(bc.Enabled != false) |
| | | try |
| | | { |
| | | MessageBox.Show("请å
çææ¡å½¢ç ï¼åçæç®±æ¡ç "); |
| | | return; |
| | | } |
| | | //-------------------æ ¹æ®HINTERIDçæç®±æ¡ç |
| | | Int64 iInterID = 0; |
| | | Int64 dPackQty = 0; //å¤ç®±æ°é |
| | | Int64 dPackLeftQty = 0; //å¤ç®±å©ä½æ°é |
| | | Int64 dLabelQty = 0; //å°ç®±æ°é |
| | | Int64 dQty = 0; //æ»æ°é |
| | | Int64 dEntryID = 0; //è¡å· |
| | | string sPackBarCode = ""; //å¤ç®±ç |
| | | string sBarCode = ""; //å¯ä¸ç |
| | | Int64 LSH = 0; |
| | | DataSet Ds; |
| | | string sYear = DateTime.Today.Year.ToString().Substring(2, 2); |
| | | string sPeriod = "0" + DateTime.Today.Month.ToString(); |
| | | sPeriod = sPeriod.Substring(sPeriod.Length - 2, 2); |
| | | string sDay = "0" + DateTime.Today.Day.ToString(); |
| | | sDay = sDay.Substring(sDay.Length - 2, 2); |
| | | // |
| | | string sPackStr = "ZXM" + sYear + sPeriod + sDay; //å¤ç®±ç åç¼ |
| | | |
| | | //çæå夿ï¼å¾ªç¯ç©æç½æ ¼ï¼å¤æ æ¯å¦è®¾ç½®äºåçç å¤ç®±æ°éã å¤ç®±æ°é å¿
é¡»æ¯ æå°å
è£
æ°ç åæ° å¹¶å¿
须大äº0å大äºçäºæå°å
è£
æ°éã |
| | | //å¿
é¡»æ¡ç çææé®æ¯ç°åº¦æå¯ä»¥çæç®±æ¡ç |
| | | if (bc.Enabled != false) |
| | | { |
| | | MessageBox.Show("请å
çææ¡å½¢ç ï¼åçæç®±æ¡ç "); |
| | | return; |
| | | } |
| | | //-------------------æ ¹æ®HINTERIDçæç®±æ¡ç |
| | | //çæå夿ï¼å¾ªç¯ç©æç½æ ¼ï¼å¤æ æ¯å¦è®¾ç½®äºåçç å¤ç®±æ°éã å¤ç®±æ°é å¿
é¡»æ¯ æå°å
è£
æ°ç åæ° å¹¶å¿
须大äº0å大äºçäºæå°å
è£
æ°éã |
| | | for (int i = 0; i < grdMain.Rows.Count; i++) |
| | | { |
| | | if (DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HMaterIDCol].Value) != 0) |
| | | { |
| | | if (DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HPackQtyCol].Value) <= 0) |
| | | { |
| | | MessageBox.Show("请å½å
¥åççå¤ç®±æ°éï¼ç¬¬" + Convert.ToString(i + 1) + "è¡"); |
| | | return; |
| | | } |
| | | if (DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HPackQtyCol].Value) |
| | | % DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HMinQtyCol].Value) != 0 |
| | | || DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HPackQtyCol].Value) |
| | | < DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HMinQtyCol].Value)) |
| | | { |
| | | MessageBox.Show("å¤ç®±æ°éå¿
é¡»æ¯æå°å
è£
æ°çåæ°ï¼ä¸å¤§äºçäºæå°å
è£
æ°ï¼ç¬¬" + Convert.ToString(i + 1) + "è¡"); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | //oCn.BeginTran(); |
| | | //ä»0è¡è¿è¡å¾ªç¯ ç©æç½æ ¼ï¼è·åå¤ç®±æ°é |
| | | for (int i = 0; i < grdMain.Rows.Count; i++) |
| | | { |
| | | if (DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HMaterIDCol].Value) != 0) |
| | | { |
| | | //è·åæ»æ°éãå¤ç®±æ°é |
| | | dPackQty = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HPackQtyCol].Value); |
| | | dQty = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HQtyCol].Value); |
| | | dEntryID = i + 1; |
| | | dPackLeftQty = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HPackQtyCol].Value); |
| | | //çæä¸ä¸ªå¤ç®±ç |
| | | Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sPackStr + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); |
| | | LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]) + 1; |
| | | sPackBarCode = sPackStr + LSH.ToString(); |
| | | oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sPackStr + "'"); |
| | | //åå¾ªç¯ æ¡ç ç½æ ¼ |
| | | for (int j = 0; j < grdSub.Rows.Count; j++) |
| | | { |
| | | if (dEntryID == DBUtility.ClsPub.isLong(grdSub.Rows[j].Cells[HEntryID2Col].Value)) |
| | | { |
| | | if (dQty <= 0) |
| | | { |
| | | continue; |
| | | } |
| | | if (dPackLeftQty > 0) //å½å©ä½å¤ç®±æ°éå°äºçäº0æ¶ï¼éæ°çæå¤ç®±ç |
| | | { |
| | | } |
| | | else |
| | | { |
| | | //çæä¸ä¸ªå¤ç®±ç |
| | | Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sPackStr + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); |
| | | LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]) + 1; |
| | | sPackBarCode = sPackStr + LSH.ToString(); |
| | | oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sPackStr + "'"); |
| | | dPackLeftQty = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HPackQtyCol].Value); |
| | | } |
| | | sBarCode = DBUtility.ClsPub.isStrNull(grdSub.Rows[j].Cells[HTMCol].Value); // æ¡ç |
| | | dLabelQty = DBUtility.ClsPub.isLong(grdSub.Rows[j].Cells[HQty2Col].Value); // å°ç®±æ°é |
| | | oCn.RunProc("update Gy_BarCodebill set HInnerBillNo= '" + sPackBarCode + "' Where HbarCode='" + sBarCode + "'"); |
| | | dPackLeftQty = dPackLeftQty - dLabelQty; |
| | | dQty = dQty - dLabelQty; |
| | | if (dPackLeftQty <= 0)//å½ç®±å©ä½æ°éå°äºçäº0æ¶ æ§è¡ ç»æå |
| | | { |
| | | //è·åç»æåå
ç |
| | | iInterID = DBUtility.ClsPub.CreateBillID("3783", ref DBUtility.ClsPub.sExeReturnInfo); ;//å¾å°æ°åå·; |
| | | //æ ¹æ®å¤ç®±ç åå
¥ ç»æå主表ï¼ç»æåå表ï¼SUMï¼å¤ç®±ç æ¡£æ¡ï¼SUMæ¡£æ¡ |
| | | oCn.RunProc("exec h_p_WMS_PackUnionBill_AddNew '" + sPackBarCode + "'," + iInterID.ToString() + ",'" + DBUtility.ClsPub.CurUserName + "'," + HInterID.ToString()); //æ ¹æ®ç®±æ¡ç ï¼åå
¥ 主表ï¼å表 ï¼ç®±æ¡ç æ¡£æ¡ |
| | | oCn.RunProc("exec h_p_WMS_PackUnionBill_SumSubBill " + iInterID.ToString() + ",'" + sPackBarCode + "','3783','" + DBUtility.ClsPub.CurUserName + "'," + HInterID.ToString()); //æ ¹æ®ç®±æ¡ç ï¼åå
¥ SUM表ï¼SUMæ¡ç æ¡£æ¡ |
| | | } |
| | | } |
| | | else |
| | | { |
| | | continue; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | wxm.Enabled = false; |
| | | //oCn.Commit(); |
| | | MessageBox.Show("çæç®±ç 宿¯ï¼"); |
| | | //å·æ°æ°æ® |
| | | Display(); |
| | | } |
| | | catch(Exception e1) |
| | | { |
| | | //oCn.RollBack(); |
| | | MessageBox.Show("çæç®±ç 失败ï¼" + e1.Message ); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | //ä»0è¡è¿è¡å¾ªç¯ ç©æç½æ ¼ï¼è·åå¤ç®±æ°é |
| | | |
| | | //åå¾ªç¯ æ¡ç ç½æ ¼ |
| | | |
| | | //æ ¹æ®å¤ç®±æ°é æ£åï¼ç´å° å¤ç®±æ°éæ£åå®ï¼çæ å¤ç®±æ¡ç åç»æå |
| | | |
| | | |
| | | //ç»æå¾ªç¯ |
| | | |
| | | //å·æ°æå°é¡µç¾ï¼-S ç èææ¡ç 䏿¾ç¤º ï¼ |
| | | |
| | | |
| | | private void cmbSourceBillType_TextChanged(object sender, EventArgs e) |
| | | { |
| | | if (cmbSourceBillType.Text == "å·¥åºæµè½¬å¡") |
| | | { |
| | | cmbHBarCodeType.Items.Clear(); |
| | | cmbHBarCodeType.Items.Add("åºåç "); |
| | | this.cmbHBarCodeType.SelectedIndex = 0; |
| | | } |
| | | else |
| | | { |
| | | cmbHBarCodeType.Items.Clear(); |
| | | cmbHBarCodeType.Items.Add("å¯ä¸æ¡ç "); |
| | | cmbHBarCodeType.Items.Add("åç§æ¡ç "); |
| | | cmbHBarCodeType.Items.Add("æ¹æ¬¡æ¡ç "); |
| | | this.cmbHBarCodeType.SelectedIndex = 0; |
| | | } |
| | | } |
| | | } |
| | | } |