| | |
| | | public const Int16 HMaterIDCol = 6; |
| | | public const Int16 HMaterNumberCol = 7; |
| | | public const Int16 HMaterNameCol = 8; |
| | | public const Int16 HPinfanCol = 9; |
| | | public const Int16 HMaterModelCol = 10; |
| | | public const Int16 HPinfanCol = 9;// |
| | | public const Int16 HMaterModelCol = 10;// |
| | | public const Int16 HModelCol = 11; |
| | | public const Int16 HAuxPropIDCol = 12; |
| | | public const Int16 HAuxPropNumberCol = 13; |
| | |
| | | public const Int16 HBarCodeTypeCol = 18; |
| | | public const Int16 HBatchManagerCol = 19; |
| | | public const Int16 HBatchNoCol = 20; |
| | | public const Int16 HQtyCol = 21; |
| | | public const Int16 HMinQtyCol = 22; |
| | | public const Int16 HBQtyCol = 23; |
| | | public const Int16 HDeptIDCol = 24; |
| | | public const Int16 HDeptNumberCol = 25; |
| | | public const Int16 HDeptNameCol = 26; |
| | | public const Int16 HSourceIDCol = 27; |
| | | public const Int16 HSourceNumberCol = 28; |
| | | public const Int16 HSourceNameCol = 29; |
| | | public const Int16 HDateCol = 30; |
| | | public const Int16 HEndDateCol = 31; |
| | | public const Int16 HSupIDCol = 32; |
| | | public const Int16 HSupNumberCol = 33; |
| | | public const Int16 HSupNameCol = 34; |
| | | public const Int16 HCusIDCol = 35; |
| | | public const Int16 HCusNumberCol = 36; |
| | | public const Int16 HCusNameCol = 37; |
| | | public const Int16 HCusTypeCol = 38; |
| | | public const Int16 HSourceInterIDCol = 39; |
| | | public const Int16 HSourceEntryIDCol = 40; |
| | | public const Int16 HSourceBillNoCol = 41; |
| | | public const Int16 HSourceBillTypeCol = 42; |
| | | public const Int16 HInstructIDCol = 43; |
| | | public const Int16 HInstructNoCol = 44; |
| | | public const Int16 HSeOrderBillIDCol = 45; |
| | | public const Int16 HSeOrderBillNoCol = 46; |
| | | public const Int16 HWhIDCol = 47; |
| | | public const Int16 HWhNumberCol = 48; |
| | | public const Int16 HWhNameCol = 49; |
| | | public const Int16 HSPIDCol = 50; |
| | | public const Int16 HSPNumberCol = 51; |
| | | public const Int16 HSPNameCol = 52; |
| | | public const Int16 HinitQtyCol = 53; |
| | | public const Int16 HRemarkCol = 54; |
| | | public const Int16 HPinfanBarCodeCol = 55; |
| | | public const Int16 HMTONoCol = 56; |
| | | public const Int16 HShowDateCol = 57; |
| | | public const Int16 HInnerBillNoCol = 58; |
| | | public const Int16 HMakerCol = 59; |
| | | public const Int16 HGiveAwayFlagCol = 21; |
| | | public const Int16 HQtyCol = 22; |
| | | public const Int16 HMinQtyCol = 23; |
| | | public const Int16 HBQtyCol = 24; |
| | | 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 HAuxPropNumber2Col = 11; |
| | | public Int16 HAuxPropName2Col = 12; |
| | | public Int16 HBatchNo2Col = 13; |
| | | public Int16 HUnitID2Col = 14; |
| | | public Int16 HUnitNumber2Col = 15; |
| | | public Int16 HUnitName2Col = 16; |
| | | public Int16 HQty2Col = 17; |
| | | public Int16 HWeiCol = 18; |
| | | public Int16 HPrintCol = 19; |
| | | public Int16 HDeptID2Col = 20; |
| | | public Int16 HDeptNumber2Col = 21; |
| | | public Int16 HDeptName2Col = 22; |
| | | public Int16 HSourceID2Col = 23; |
| | | public Int16 HSourceNumber2Col = 24; |
| | | public Int16 HSourceName2Col = 25; |
| | | public Int16 HDate2Col = 26; |
| | | public Int16 HEndDate2Col = 27; |
| | | public Int16 HBarcodeNoCol = 28; |
| | | public Int16 HBarcodeQtysCol = 29; |
| | | public Int16 HSupID2Col = 30; |
| | | public Int16 HSupNumber2Col = 31; |
| | | public Int16 HSupName2Col = 32; |
| | | public Int16 HCusID2Col = 33; |
| | | public Int16 HCusNumber2Col = 34; |
| | | public Int16 HCusName2Col = 35; |
| | | public Int16 HCusType2Col = 36; |
| | | public Int16 HSourceInterID2Col = 37; |
| | | public Int16 HSourceEntryID2Col = 38; |
| | | public Int16 HSourceBillNo2Col = 39; |
| | | public Int16 HSourceBillType2Col = 40; |
| | | public Int16 HInstructID2Col = 41; |
| | | public Int16 HInstructNo2Col = 42; |
| | | public Int16 HSeOrderBillID2Col = 43; |
| | | public Int16 HSeOrderBillNo2Col = 44; |
| | | public Int16 HWhID2Col = 45; |
| | | public Int16 HWhNumber2Col = 46; |
| | | public Int16 HWhName2Col = 47; |
| | | public Int16 HSPID2Col = 48; |
| | | public Int16 HSPNumber2Col = 49; |
| | | public Int16 HSPName2Col = 50; |
| | | public Int16 HRemark2Col = 51; |
| | | public Int16 HPinfanBarCode2Col = 52; |
| | | public Int16 HMTONo2Col = 53; |
| | | public Int16 HShowDate2Col = 54; |
| | | public Int16 HInnerBillNo2Col = 55; |
| | | public Int16 HMaker2Col = 56; |
| | | public Int16 HGiveAwayFlag2Col = 14; |
| | | public Int16 HUnitID2Col = 15; |
| | | public Int16 HUnitNumber2Col = 16; |
| | | public Int16 HUnitName2Col = 17; |
| | | public Int16 HQty2Col = 18; |
| | | public Int16 HWeiCol = 19; |
| | | public Int16 HPrintCol = 20; |
| | | public Int16 HDeptID2Col = 21; |
| | | public Int16 HDeptNumber2Col = 22; |
| | | public Int16 HDeptName2Col = 23; |
| | | public Int16 HSourceID2Col = 24; |
| | | public Int16 HSourceNumber2Col = 25; |
| | | public Int16 HSourceName2Col = 26; |
| | | public Int16 HDate2Col = 27; |
| | | public Int16 HEndDate2Col = 28; |
| | | public Int16 HBarcodeNoCol = 29; |
| | | public Int16 HBarcodeQtysCol = 30; |
| | | public Int16 HSupID2Col = 31; |
| | | public Int16 HSupNumber2Col = 32; |
| | | public Int16 HSupName2Col = 33; |
| | | public Int16 HCusID2Col = 34; |
| | | public Int16 HCusNumber2Col = 35; |
| | | public Int16 HCusName2Col = 36; |
| | | public Int16 HCusType2Col = 37; |
| | | public Int16 HSourceInterID2Col = 38; |
| | | public Int16 HSourceEntryID2Col = 39; |
| | | public Int16 HSourceBillNo2Col = 40; |
| | | public Int16 HSourceBillType2Col = 41; |
| | | public Int16 HInstructID2Col = 42; |
| | | public Int16 HInstructNo2Col = 43; |
| | | public Int16 HSeOrderBillID2Col = 44; |
| | | public Int16 HSeOrderBillNo2Col = 45; |
| | | 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 åºå®ä»£ç |
| | | |
| | | //æ¸
空çé¢ |
| | |
| | | cmbHBarCodeType.Items.Clear(); |
| | | cmbSourceBillType.Items.Clear(); |
| | | |
| | | cmbHBarCodeType.Items.Add("å¯ä¸æ¡ç "); |
| | | cmbHBarCodeType.Items.Add("åç§æ¡ç "); |
| | | cmbHBarCodeType.Items.Add("æ¹æ¬¡æ¡ç "); |
| | | //cmbHBarCodeType.Items.Add("æçæ¡ç "); |
| | | //æ ¹æ®ç³»ç»åæ°è·å对åºçæ¡ç ç±»åï¼å¤å®çµå¨ã忥 以åä½¿ç¨æ¡ç è§åè¡¨ï¼ |
| | | ClsXt_SystemParameter oClsXt_SystemParameter = new ClsXt_SystemParameter(); |
| | | string sCapName = oClsXt_SystemParameter.GetSingleSystemParameter("WMS_CampanyName", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if(sCapName=="å¤å®çµå¨") |
| | | { |
| | | cmbHBarCodeType.Items.Add("å
éæºæ¡ç "); |
| | | cmbHBarCodeType.Items.Add("å¤éæºæ¡ç "); |
| | | cmbHBarCodeType.Items.Add("åæåæ¡ç "); |
| | | } |
| | | else if (sCapName == "åæ¥ç§æ") |
| | | { |
| | | cmbHBarCodeType.Items.Add("仪å¨å¤è´ä»¶æ¡ç æ®éè§å"); |
| | | cmbHBarCodeType.Items.Add("仪å¨å¤è´ä»¶æ¡ç 容å¨è§å"); |
| | | cmbHBarCodeType.Items.Add("ä»ªå¨æåæ¡ç è§å"); |
| | | cmbHBarCodeType.Items.Add("è¯åæåæ¡ç è§å"); |
| | | } |
| | | else |
| | | { |
| | | // |
| | | cmbHBarCodeType.Items.Add("å¯ä¸æ¡ç "); |
| | | cmbHBarCodeType.Items.Add("åç§æ¡ç "); |
| | | cmbHBarCodeType.Items.Add("æ¹æ¬¡æ¡ç "); |
| | | //cmbHBarCodeType.Items.Add("æçæ¡ç "); |
| | | } |
| | | |
| | | // |
| | | cmbSourceBillType.Items.Add("ç产订å"); |
| | | cmbSourceBillType.Items.Add("çäº§æ±æ¥å"); |
| | | cmbSourceBillType.Items.Add("éè´è®¢å"); |
| | | cmbSourceBillType.Items.Add("æ¶æéç¥å"); |
| | | cmbSourceBillType.Items.Add("å§å¤è®¢å"); |
| | | cmbSourceBillType.Items.Add("å·¥åºæ±æ¥å"); |
| | | cmbSourceBillType.Items.Add("å·¥åºæµè½¬å¡"); |
| | | cmbSourceBillType.Items.Add("éè´§éç¥å"); |
| | | cmbSourceBillType.Items.Add("å
¶ä»å
¥åºå"); |
| | | cmbSourceBillType.Items.Add("ç´æ¥è°æ¨å"); |
| | |
| | | { |
| | | this.Sub_SaveBill(); |
| | | Display(); |
| | | |
| | | } |
| | | |
| | | //éç½®æçº½ |
| | |
| | | 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(); |
| | |
| | | return false; |
| | | } |
| | | bc.Enabled = false; |
| | | SaveBarCode(); |
| | | if (cmbHBarCodeType.Text == "ä»ªå¨æåæ¡ç è§å") |
| | | { |
| | | SaveBarCode_bori(); //ç©æç¼ç +åºåå·+çäº§æ¥æ |
| | | } |
| | | else |
| | | { |
| | | SaveBarCode(); |
| | | } |
| | | return true; |
| | | } |
| | | |
| | |
| | | int LSHlen = 6; //æµæ°´å·é¿åº¦ |
| | | int SumLen = 10; //æ»é¿åº¦ |
| | | string TM = ""; //æ¡ç |
| | | string HNumber = ""; //ç©æä»£ç |
| | | string HNumber = ""; //ç©æå
ç |
| | | 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 sPeriod = ""; //æ |
| | | string sDay = ""; //æ¥ |
| | | string HBatchNo = ""; //æ¹æ¬¡ |
| | | string HYasuoji = ""; //åç¼©æº |
| | | string HModelName = ""; //æºå |
| | | string HICMOBillNo = ""; //æºåå· |
| | | 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"); |
| | |
| | | if (ClsPub.isLong(grdMain.Rows[j].Cells[HMaterIDCol].Value) != 0) |
| | | { |
| | | HNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HMaterIDCol].Value); |
| | | HMaterNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HMaterNumberCol].Value); |
| | | HBatchNo = ClsPub.isStrNull(grdMain.Rows[j].Cells[HBatchNoCol].Value); |
| | | //æ¥æè·åæ¹å¼ |
| | | sDate = dtpHDate.Value.ToShortDateString(); |
| | | // |
| | | if (cmbHBarCodeType.Text == "仪å¨å¤è´ä»¶æ¡ç æ®éè§å" || cmbHBarCodeType.Text == "仪å¨å¤è´ä»¶æ¡ç 容å¨è§å") //åæ®æ¥æ(æ¶æéç¥å) |
| | | { |
| | | sDate = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HDateCol].Value); |
| | | } |
| | | else if (cmbHBarCodeType.Text == "è¯åæåæ¡ç è§å")// å¤±ææ¥æï¼ç产订åï¼ |
| | | { |
| | | sDate = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HEndDateCol].Value); |
| | | } |
| | | else if (CampanyName == "å¤å®çµå¨")// æ¥æï¼çäº§è®¢å æ¡ç æ¥æ |
| | | { |
| | | sDate = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HDateCol].Value); |
| | | } |
| | | HYasuoji= DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HPinfanCol].Value); //å缩æºä»£ç ï¼å¤å®çµå¨ï¼ |
| | | HModelName= DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HCusTypeCol].Value); //æºåï¼å¤å®çµå¨ï¼ |
| | | HICMOBillNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HSourceBillNoCol].Value); //ç产订åå·ï¼å¤å®çµå¨ï¼ |
| | | HBarCodeBatchNo= DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HPinfanBarCodeCol].Value); //æ¡ç æ¹æ¬¡å·ï¼å¤å®çµå¨ï¼ |
| | | HBarCodeDate= DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HSupNumberCol].Value); //æ¡ç æ¥æï¼å¤å®çµå¨ï¼ |
| | | // |
| | | sYear = ClsPub.isDate(sDate).Year.ToString().Substring(2, 2); |
| | | sPeriod = "0" + ClsPub.isDate(sDate).Month.ToString(); |
| | | sPeriod = sPeriod.Substring(sPeriod.Length - 2, 2); |
| | |
| | | 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 == "åç§æ¡ç ") |
| | |
| | | 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.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.isLong(Ds.Tables[0].Rows[0][0]); |
| | | } |
| | | else if (cmbHBarCodeType.Text == "è¯åæåæ¡ç è§å") |
| | | { |
| | | //ç©æç¼ç +ç产æ¹å·+æµæ°´å·6ä½- |
| | | 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.isLong(Ds.Tables[0].Rows[0][0]); |
| | | LSHlen = 6; |
| | | } |
| | | else if (cmbHBarCodeType.Text == "å
éæºæ¡ç ") |
| | | { |
| | | //å¶é æ¬é¨1ä½ï¼é»è®¤1ï¼+æºå代ç 5ä½ï¼ï¼+å¹´2ä½+æ1ä½ï¼AãBãC代æ¿10æä»½ï¼ |
| | | //+æ¥2ä½+æ¡ç æ¹æ¬¡ç 2ä½+å缩æºä»£ç 1ä½+00+æµæ°´å·4ä½+æ ¡éªç ï¼é»è®¤0ï¼ |
| | | 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.isLong(Ds.Tables[0].Rows[0][0]); |
| | | LSHlen = 4; |
| | | if (sTMNumber.Length != 16 && sTMNumber.Length != 15) |
| | | { |
| | | MessageBox.Show("æ¡ç é¿åº¦ä¸å¤15æ16ä½ï¼æ¯å¦æ°æ®ä¸å
¨ï¼å¶é æ¬é¨1ä½:[0] + æºå代ç 5ä½:[" + HModelName + "] + å¹´ææ¥4æ5ä½:["+ HBarCodeDate + "] + æ¹æ¬¡å·2ä½:[" + HBarCodeBatchNo + "]+ å缩æº1ä½:["+ HYasuoji + "]+00 ; "); |
| | | return; |
| | | } |
| | | } |
| | | else if (cmbHBarCodeType.Text == "å¤éæºæ¡ç ") |
| | | { |
| | | //ç©æä»£ç 11ä½+å¹´2ä½+æ1ä½ï¼AãBãC代æ¿10æä»½ï¼+æ¥2ä½+æ¹æ¬¡2ä½+æµæ°´å·4ä½ |
| | | //sTMNumber = HMaterNumber.Replace(Convert.ToChar("."),Convert.ToChar("")) + HBarCodeDate + HBarCodeBatchNo; |
| | | 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.isLong(Ds.Tables[0].Rows[0][0]); |
| | | LSHlen = 4; |
| | | if (sTMNumber.Length != 18 && sTMNumber.Length != 17) |
| | | { |
| | | MessageBox.Show("æ¡ç é¿åº¦ä¸å¤17æ18ä½ï¼æ¯å¦æ°æ®ä¸å
¨ï¼ç©æä»£ç 11ä½:["+ HMaterNumber.Replace(".", "") + "]+å¹´ææ¥4æ5ä½:["+ HBarCodeDate + "]+æ¹æ¬¡å·2ä½:[" + HBarCodeBatchNo + "];"); |
| | | return; |
| | | } |
| | | } |
| | | else if (cmbHBarCodeType.Text == "åæåæ¡ç ") |
| | | { |
| | | //ç产订åå·+4使µæ°´å· |
| | | 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.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 == "å¤éæºæ¡ç ") |
| | | { |
| | | TM = sTMNumber + LSH2; |
| | | |
| | | } |
| | | else if (cmbHBarCodeType.Text == "å
éæºæ¡ç ") |
| | | { |
| | | TM = sTMNumber + LSH2 + "0"; |
| | | } |
| | | // |
| | | if (i + 1 > grdSub.Rows.Count) |
| | | { |
| | | grdSub.RowCount = grdSub.RowCount + 1; |
| | | } |
| | | grdSub.Rows[i].Cells[HSno2Col].Value = ClsPub.isStrNull(i + 1); |
| | | if (TM.Trim() == "") |
| | | { |
| | | MessageBox.Show("æ¡å½¢ç ä¸è½ä¸ºç©ºï¼ä¸è½çææ¡ç ï¼"); |
| | | 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[HMaterModel2Col].Value = grdMain.Rows[j].Cells[HMaterModelCol].Value; |
| | | grdSub.Rows[i].Cells[HPinfan2Col].Value = grdMain.Rows[j].Cells[HPinfanCol].Value; |
| | | grdSub.Rows[i].Cells[HPinfanBarCode2Col].Value = grdMain.Rows[j].Cells[HPinfanBarCodeCol].Value; |
| | | |
| | | grdSub.Rows[i].Cells[HAuxPropID2Col].Value = grdMain.Rows[j].Cells[HAuxPropIDCol].Value; |
| | | grdSub.Rows[i].Cells[HAuxPropNumber2Col].Value = grdMain.Rows[j].Cells[HAuxPropNumberCol].Value; |
| | | grdSub.Rows[i].Cells[HAuxPropName2Col].Value = grdMain.Rows[j].Cells[HAuxPropNameCol].Value; |
| | | |
| | | grdSub.Rows[i].Cells[HUnitID2Col].Value = grdMain.Rows[j].Cells[HUnitIDCol].Value; |
| | | grdSub.Rows[i].Cells[HUnitNumber2Col].Value = grdMain.Rows[j].Cells[HUnitNumberCol].Value; |
| | | grdSub.Rows[i].Cells[HUnitName2Col].Value = grdMain.Rows[j].Cells[HUnitNameCol].Value; |
| | | |
| | | grdSub.Rows[i].Cells[HQty2Col].Value = HMinQty; |
| | | grdSub.Rows[i].Cells[HBatchNo2Col].Value = grdMain.Rows[j].Cells[HBatchNoCol].Value; |
| | | grdSub.Rows[i].Cells[HSourceInterID2Col].Value = grdMain.Rows[j].Cells[HMainIDCol].Value; |
| | | grdSub.Rows[i].Cells[HSourceEntryID2Col].Value = grdMain.Rows[j].Cells[HSubIDCol].Value; |
| | | grdSub.Rows[i].Cells[HSourceBillNo2Col].Value = grdMain.Rows[j].Cells[HBillNoCol].Value; |
| | | grdSub.Rows[i].Cells[HSourceBillType2Col].Value = grdMain.Rows[j].Cells[HBillTypeCol].Value; |
| | | grdSub.Rows[i].Cells[HPrintCol].Value = "0"; |
| | | grdSub.Rows[i].Cells[HWeiCol].Value = WeiShu; |
| | | grdSub.Rows[i].Cells[HBarcodeNoCol].Value = n + 1; |
| | | grdSub.Rows[i].Cells[HBarcodeQtysCol].Value = grdMain.Rows[j].Cells[HBQtyCol].Value; |
| | | grdSub.Rows[i].Cells[HSupID2Col].Value = grdMain.Rows[j].Cells[HSupIDCol].Value; |
| | | grdSub.Rows[i].Cells[HSupNumber2Col].Value = grdMain.Rows[j].Cells[HSupNumberCol].Value; |
| | | grdSub.Rows[i].Cells[HSupName2Col].Value = grdMain.Rows[j].Cells[HSupNameCol].Value; |
| | | grdSub.Rows[i].Cells[HDeptID2Col].Value = grdMain.Rows[j].Cells[HDeptIDCol].Value; |
| | | grdSub.Rows[i].Cells[HDeptNumber2Col].Value = grdMain.Rows[j].Cells[HDeptNumberCol].Value; |
| | | grdSub.Rows[i].Cells[HDeptName2Col].Value = grdMain.Rows[j].Cells[HDeptNameCol].Value; |
| | | grdSub.Rows[i].Cells[HRemark2Col].Value = grdMain.Rows[j].Cells[HRemarkCol].Value; |
| | | grdSub.Rows[i].Cells[HDate2Col].Value = grdMain.Rows[j].Cells[HDateCol].Value; |
| | | grdSub.Rows[i].Cells[HShowDate2Col].Value = grdMain.Rows[j].Cells[HShowDateCol].Value; |
| | | grdSub.Rows[i].Cells[HWhID2Col].Value = grdMain.Rows[j].Cells[HWhIDCol].Value; |
| | | grdSub.Rows[i].Cells[HWhNumber2Col].Value = grdMain.Rows[j].Cells[HWhNumberCol].Value; |
| | | grdSub.Rows[i].Cells[HWhName2Col].Value = grdMain.Rows[j].Cells[HWhNameCol].Value; |
| | | grdSub.Rows[i].Cells[HSPID2Col].Value = grdMain.Rows[j].Cells[HSPIDCol].Value; |
| | | grdSub.Rows[i].Cells[HSPNumber2Col].Value = grdMain.Rows[j].Cells[HSPNumberCol].Value; |
| | | grdSub.Rows[i].Cells[HSPName2Col].Value = grdMain.Rows[j].Cells[HSPNameCol].Value; |
| | | grdSub.Rows[i].Cells[HMTONo2Col].Value = grdMain.Rows[j].Cells[HMTONoCol].Value; |
| | | grdSub.Rows[i].Cells[HCusID2Col].Value = grdMain.Rows[j].Cells[HCusIDCol].Value; |
| | | grdSub.Rows[i].Cells[HCusNumber2Col].Value = grdMain.Rows[j].Cells[HCusNumberCol].Value; |
| | | grdSub.Rows[i].Cells[HCusName2Col].Value = grdMain.Rows[j].Cells[HCusNameCol].Value; |
| | | grdSub.Rows[i].Cells[HCusType2Col].Value = grdMain.Rows[j].Cells[HCusTypeCol].Value; |
| | | grdSub.Rows[i].Cells[HSourceID2Col].Value = grdMain.Rows[j].Cells[HSourceIDCol].Value; |
| | | grdSub.Rows[i].Cells[HSourceNumber2Col].Value = grdMain.Rows[j].Cells[HSourceNumberCol].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; |
| | | //ç½æ ¼æå¾ |
| | | DataGridViewCheckBoxCell oCell = new DataGridViewCheckBoxCell(); |
| | | oCell.ThreeState = false; |
| | | oCell.Value = grdSub.Rows[i].Cells[HGiveAwayFlag2Col].Value; |
| | | oCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; |
| | | grdSub.Rows[i].Cells[HGiveAwayFlag2Col] = oCell; |
| | | k = k + 1; |
| | | n = n + 1; |
| | | //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); |
| | | nn = nn + 1; |
| | | } |
| | | //åå°æ¹éæ§è¡è¯å¥ |
| | | oCn.RunProc("exec h_p_WMS_SetMaxNo_QTY '" + sTMNumber + "'," + nn.ToString() + " "); |
| | | } |
| | | } |
| | | string HWei = ""; //å°¾æ° |
| | | string HBarCode = ""; |
| | | string HBarCodeType = ""; |
| | | Int64 HMaterID = 0; |
| | | Int64 HAuxPropID = 0; |
| | | Int64 HUnitID = 0; |
| | | double HQty2 = 0; |
| | | string HBatchNo2 = ""; |
| | | Int64 HSupID = 0; |
| | | Int64 HGroupID = 0; |
| | | int HPrintQty = 0; |
| | | Int64 HSourceInterID = 0; |
| | | Int64 HSourceEntryID = 0; |
| | | string HSourceBillNo = ""; |
| | | string HSourceBillType = ""; |
| | | Int64 HBarcodeNo = 0; //æå· |
| | | Int64 HBarcodeQtys = 0; //æ»ææ° |
| | | Int64 HDeptID = 0; |
| | | Int64 HWhID = 0; |
| | | Int64 HSPID = 0; |
| | | string HRemark = ""; |
| | | string HMaterName = ""; |
| | | string HMaterModel = ""; |
| | | string HPinfan = ""; |
| | | string HMTONo = ""; |
| | | Int64 HCusID = 0; |
| | | string HCusType = ""; |
| | | DateTime HEndDate; |
| | | string HWorkLineName = ""; |
| | | string HSeOrderBillNo = ""; |
| | | Int64 HSeOrderSEQ = 0; |
| | | string HInnerBillNo = ""; |
| | | bool HGiveAwayFlag = false; |
| | | Int64 HEntryID = 0; |
| | | try |
| | | { |
| | | oCn.BeginTran(); |
| | | for (int i = 0; i < grdSub.Rows.Count; i++) |
| | | { |
| | | if (ClsPub.isLong(grdSub.Rows[i].Cells[HMaterID2Col].Value) != 0) |
| | | { |
| | | HWei = ClsPub.isStrNull(grdSub.Rows[i].Cells[HWeiCol].Value); |
| | | HBarCode = ClsPub.isStrNull(grdSub.Rows[i].Cells[HTMCol].Value); |
| | | // |
| | | HBarCodeType = ClsPub.isStrNull(cmbHBarCodeType.Text); |
| | | if (CampanyName == "åæ¥ç§æ" || CampanyName == "å¤å®çµå¨") |
| | | { |
| | | HBarCodeType = "å¯ä¸æ¡ç "; |
| | | } |
| | | // |
| | | 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); |
| | | HBatchNo2 = ClsPub.isStrNull(grdSub.Rows[i].Cells[HBatchNo2Col].Value); |
| | | HSourceInterID = ClsPub.isLong(grdSub.Rows[i].Cells[HSourceInterID2Col].Value); |
| | | HSourceEntryID = ClsPub.isLong(grdSub.Rows[i].Cells[HSourceEntryID2Col].Value); |
| | | HSourceBillNo = ClsPub.isStrNull(grdSub.Rows[i].Cells[HSourceBillNo2Col].Value); |
| | | HSourceBillType = ClsPub.isStrNull(grdSub.Rows[i].Cells[HSourceBillType2Col].Value); |
| | | HBarcodeQtys = ClsPub.isLong(grdSub.Rows[i].Cells[HBarcodeQtysCol].Value); |
| | | HBarcodeNo = ClsPub.isLong(grdSub.Rows[i].Cells[HBarcodeNoCol].Value); |
| | | HSupID = ClsPub.isLong(grdSub.Rows[i].Cells[HSupID2Col].Value); |
| | | HDeptID = ClsPub.isLong(grdSub.Rows[i].Cells[HDeptID2Col].Value); |
| | | HWhID = ClsPub.isLong(grdSub.Rows[i].Cells[HWhID2Col].Value); |
| | | HSPID = ClsPub.isLong(grdSub.Rows[i].Cells[HSPID2Col].Value); |
| | | HRemark = ClsPub.isStrNull(grdSub.Rows[i].Cells[HRemark2Col].Value); |
| | | HMaterName = ClsPub.isStrNull(grdSub.Rows[i].Cells[HMaterName2Col].Value); |
| | | HMaterModel = ClsPub.isStrNull(grdSub.Rows[i].Cells[HMaterModel2Col].Value); |
| | | HPinfan = ClsPub.isStrNull(grdSub.Rows[i].Cells[HPinfan2Col].Value); |
| | | HMTONo = ClsPub.isStrNull(grdSub.Rows[i].Cells[HMTONo2Col].Value); |
| | | HCusID = ClsPub.isLong(grdSub.Rows[i].Cells[HCusID2Col].Value); |
| | | HCusType = ClsPub.isStrNull(grdSub.Rows[i].Cells[HCusType2Col].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" + |
| | | ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " + |
| | | ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " + |
| | | ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate " + |
| | | ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " + |
| | | ",HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID " + |
| | | ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo " + |
| | | ") values (" |
| | | + "'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString() |
| | | + ",'" + HBatchNo2 + "'," + HSupID.ToString() + "," + HGroupID.ToString() + ",'" + ClsPub.CurUserName + "',getdate()," + HPrintQty.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() + "," + HEntryID.ToString() + "" |
| | | + ", " + DBUtility.ClsPub.BoolToString(HGiveAwayFlag) + "," + HSeOrderSEQ.ToString() + "," + HSourceEntryID.ToString() |
| | | + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HInnerBillNo + "')"); |
| | | |
| | | |
| | | //HNumber = ClsPub.isStrNull(grdSub.Rows[i].Cells[HMaterID2Col].Value); |
| | | //if (cmbHBarCodeType.Text == "å¯ä¸æ¡ç ") |
| | | //{ |
| | | // if (CampanyName == "åå") //ç³»ç»åæ° å®¢æ·å®å¶ååç§° |
| | | // { |
| | | // //æ¡ç åç¼ = ç©æä»£ç + å¹´ + æ + æ¥ |
| | | // sTMNumber = HNumber + sYear + sPeriod + sDay; |
| | | // } |
| | | // else if (CampanyName == "é£é¾") |
| | | // { |
| | | // string HWorksNumber = ""; |
| | | // HWorksNumber = cmbHWorksNumber.Text; |
| | | // if (HWorksNumber == "") |
| | | // { |
| | | // MessageBox.Show("å·¥å代ç ä¸è½ä¸ºç©ºï¼"); |
| | | // return; |
| | | // } |
| | | // //æ¡ç åç¼ = å·¥å代ç + ç©æå
ç + æ¥æ |
| | | // sTMNumber = HWorksNumber + HNumber + sYear + sPeriod + sDay; |
| | | // } |
| | | // else //éç¨æ¹æ³ |
| | | // { |
| | | // //æ¡ç åç¼ = ç»ç»ä»£ç + ç©æä»£ç + å¹´ + æ + æ¥ |
| | | // sTMNumber = HOrgNumber + HNumber + sYear + sPeriod + sDay; |
| | | // } |
| | | //} |
| | | //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); |
| | | } |
| | | } |
| | | //å¢å æ¡ç è¶
è¿æªçæåè½æ§å¶ |
| | | |
| | | // |
| | | oCn.Commit(); |
| | | MessageBox.Show("æ¡ç çæå®æ¯ï¼"); |
| | | //grdSub.RowCount = 0; |
| | | tabControl1.SelectedIndex = 1; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCn.RollBack(); |
| | | MessageBox.Show("æ¡ç çæå¤±è´¥ï¼" + e.Message); |
| | | grdSub.RowCount = 0; |
| | | } |
| | | } |
| | | |
| | | ////æä»½è½¬å |
| | | //private string Sub_PeriodChange(string sPeriod) |
| | | //{ |
| | | // if(sPeriod=="10") |
| | | // { |
| | | // return "A"; |
| | | // } |
| | | // else if (sPeriod == "11") |
| | | // { |
| | | // return "B"; |
| | | // } |
| | | // else if (sPeriod == "12") |
| | | // { |
| | | // return "C"; |
| | | // } |
| | | // else |
| | | // { |
| | | // return sPeriod.Substring(1, 1); |
| | | // } |
| | | //} |
| | | |
| | | |
| | | //çææ¡ç 忥 |
| | | //ç©æç¼ç +åºåå·+çäº§æ¥æ |
| | | private void SaveBarCode_bori() |
| | | { |
| | | grdSub.Rows.Clear(); |
| | | int LSHlen = 6; //æµæ°´å·é¿åº¦ |
| | | int SumLen = 10; //æ»é¿åº¦ |
| | | string TM = ""; //æ¡ç |
| | | string HNumber = ""; //ç©æå
ç |
| | | string HMaterNumber = ""; //ç©æä»£ç |
| | | double HSumQty = 0; //äº§åæ°é |
| | | double HMinQty = 0; //æå°å
è£
æ° |
| | | Int64 HBQty = 0; //ç®±æ° |
| | | double HQty = 0; //æ°é |
| | | string WeiShu = ""; //å°¾æ° |
| | | //int LSH = 0; //æµæ°´å· |
| | | string LSH2 = ""; //æµæ°´å·è½¬æ¢æå符 |
| | | string sDate = ""; //æ¥æ |
| | | string sYear = ""; //å¹´ |
| | | string sPeriod = ""; //æ |
| | | string sDay = ""; //æ¥ |
| | | string HBatchNo = ""; //æ¹æ¬¡ |
| | | int k = 0; |
| | | int n = 0; //å䏿¹çææ¡ç ä¸çç¬¬å æ¡ |
| | | string sTMNumber = ""; //æ¡ç èªå®ä¹åç¼ |
| | | DataSet Ds; |
| | | //Ds = oCn.RunProcReturn("exec GetLSH '" + ClsPub.GetServerDate(0) + "'", "GetLSH"); |
| | | //LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]); |
| | | for (int j = 0; j < grdMain.Rows.Count; j++) |
| | | { |
| | | if (ClsPub.isLong(grdMain.Rows[j].Cells[HMaterIDCol].Value) != 0) |
| | | { |
| | | HNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HMaterIDCol].Value); |
| | | HMaterNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HMaterNumberCol].Value); |
| | | HBatchNo = ClsPub.isStrNull(grdMain.Rows[j].Cells[HBatchNoCol].Value); |
| | | //æ¥æè·åæ¹å¼ |
| | | sDate = dtpHDate.Value.ToShortDateString(); |
| | | // |
| | | if (cmbHBarCodeType.Text == "è¯åæåæ¡ç è§å")// å¤±ææ¥æï¼ç产订åï¼ |
| | | { |
| | | sDate = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HEndDateCol].Value); |
| | | } |
| | | // |
| | | sYear = ClsPub.isDate(sDate).Year.ToString().Substring(2, 2); |
| | | sPeriod = "0" + ClsPub.isDate(sDate).Month.ToString(); |
| | | sPeriod = sPeriod.Substring(sPeriod.Length - 2, 2); |
| | | sDay = "0" + ClsPub.isDate(sDate).Day.ToString(); |
| | | sDay = sDay.Substring(sDay.Length - 2, 2); |
| | | //================================== |
| | | //if (cmbHBarCodeType.Text == "è¯åæåæ¡ç è§å") |
| | | //{ |
| | | // //æ¡ç åç¼ = ç»ç»ä»£ç + ç©æä»£ç + å¹´ + æ + æ¥ |
| | | //sTMNumber = HMaterNumber + 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]); |
| | | //} |
| | | //else |
| | | //{ |
| | | // MessageBox.Show("éè¯¯çæ¡ç ç±»åï¼ä¸è½çææ¡ç ï¼"); |
| | | // return; |
| | | //} |
| | | |
| | | 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; |
| | | //ä»éè¶åºåå·è¡¨è·ååºåå· |
| | | DataSet DSet = oCn.RunProcReturn("exec h_p_CLD_GetBarCodeSno "+ ClsPub.isStrNull(grdMain.Rows[j].Cells[HMainIDCol].Value) + "," + ClsPub.isStrNull(grdMain.Rows[j].Cells[HSubIDCol].Value) + " ", "h_p_CLD_GetBarCodeSno", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //çæé¦è¡æ é¢ |
| | | if (DSet == null) |
| | | { |
| | | MessageBox.Show("没æè¿åä»»ä½ç»æ,éè¶äºåºåå·ä¸åå¨ï¼" + DBUtility.ClsPub.sExeReturnInfo); |
| | | continue; |
| | | } |
| | | // |
| | | |
| | | for (int i = k; i < DSet.Tables[0].Rows.Count; i++) |
| | | //for (int i = k; i < HBQty; i++) |
| | | { |
| | | if (HSumQty - HMinQty > 0) |
| | | { |
| | | WeiShu = ""; |
| | | HSumQty = HSumQty - HMinQty; |
| | | } |
| | | else |
| | | { |
| | | if (HSumQty == HMinQty) |
| | | { |
| | | WeiShu = ""; |
| | | } |
| | | else |
| | | { |
| | | WeiShu = "å°¾æ°"; |
| | | } |
| | | HMinQty = HSumQty; |
| | | } |
| | | // |
| | | //LSH = LSH + 1; |
| | | LSH2 =DBUtility.ClsPub.isStrNull(DSet.Tables[0].Rows[n]["SHNO"]); |
| | | //while (LSH2.Length < LSHlen) //å¦ææµæ°´å·å°äº6使°åé¢è¡¥0 |
| | | //{ |
| | | // LSH2 = "0" + LSH2; |
| | | //} |
| | | //if (cmbHBarCodeType.Text == "å¯ä¸æ¡ç ") |
| | | //{ |
| | | //æ¡ç ç¼å· = æ¡ç åç¼ + æµæ°´å· |
| | | //T/*M*/ = HMaterNumber + LSH2 + sYear + sPeriod + sDay; |
| | | TM = LSH2 + sYear + sPeriod + sDay; |
| | | //} |
| | | |
| | | if (i + 1 > grdSub.Rows.Count) |
| | | { |
| | |
| | | grdSub.Rows[i].Cells[HSeOrderBillNo2Col].Value = grdMain.Rows[j].Cells[HSeOrderBillNoCol].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; |
| | | //ç½æ ¼æå¾ |
| | | DataGridViewCheckBoxCell oCell = new DataGridViewCheckBoxCell(); |
| | | oCell.ThreeState = false; |
| | | oCell.Value = grdSub.Rows[i].Cells[HGiveAwayFlag2Col].Value; |
| | | oCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; |
| | | 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 + "'"); |
| | | } |
| | | } |
| | | } |
| | |
| | | string HWorkLineName = ""; |
| | | string HSeOrderBillNo = ""; |
| | | string HInnerBillNo = ""; |
| | | bool HGiveAwayFlag = false; |
| | | try |
| | | { |
| | | oCn.BeginTran(); |
| | |
| | | { |
| | | HWei = ClsPub.isStrNull(grdSub.Rows[i].Cells[HWeiCol].Value); |
| | | HBarCode = ClsPub.isStrNull(grdSub.Rows[i].Cells[HTMCol].Value); |
| | | // |
| | | HBarCodeType = ClsPub.isStrNull(cmbHBarCodeType.Text); |
| | | if (CampanyName == "åæ¥ç§æ" || CampanyName == "å¤å®çµå¨") |
| | | { |
| | | HBarCodeType = "å¯ä¸æ¡ç "; |
| | | } |
| | | // |
| | | HMaterID = ClsPub.isLong(grdSub.Rows[i].Cells[HMaterID2Col].Value); |
| | | HAuxPropID = ClsPub.isLong(grdSub.Rows[i].Cells[HAuxPropID2Col].Value); |
| | | HUnitID = ClsPub.isLong(grdSub.Rows[i].Cells[HUnitID2Col].Value); |
| | |
| | | HWorkLineName = ClsPub.isStrNull(grdSub.Rows[i].Cells[HSourceName2Col].Value); |
| | | HSeOrderBillNo = ClsPub.isStrNull(grdSub.Rows[i].Cells[HSeOrderBillNo2Col].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" + |
| | | ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " + |
| | | ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " + |
| | | ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate " + |
| | | ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID " + |
| | | ",HGiveAwayFlag " + |
| | | ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo " + |
| | | ") values (" |
| | | + "'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString() |
| | |
| | | + ", " + 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) |
| | | + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HInnerBillNo + "')"); |
| | | |
| | | |
| | |
| | | // |
| | | grdMain.RowCount = 0; |
| | | grdSub.RowCount = 0; |
| | | grdMain.ColumnCount = 60; //æ»åæ° |
| | | grdMain.ColumnCount = 63; //æ»åæ° |
| | | DBUtility.Xt_BaseBillFun.initGridFst(grdMain, this.Name); |
| | | grdMain.Columns[HSnoCol].HeaderText = "åºå·"; |
| | | grdMain.Columns[HMainIDCol].HeaderText = "æºå主ID"; |
| | |
| | | grdMain.Columns[HBarCodeTypeCol].HeaderText = "æ¡ç ç±»å"; |
| | | grdMain.Columns[HBatchManagerCol].HeaderText = "æ¯å¦å¯ç¨æ¹æ¬¡"; |
| | | grdMain.Columns[HBatchNoCol].HeaderText = "æ¹å·"; |
| | | 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(); |
| | | |
| | | //è®¾ç½®ç¹æ®å |
| | | for (int i = 0; i < grdMain.Rows.Count; i++) |
| | | { |
| | | //ç½æ ¼æå¾ |
| | | DataGridViewCheckBoxCell oCell = new DataGridViewCheckBoxCell(); |
| | | oCell.ThreeState = false; |
| | | oCell.Value = 0; |
| | | oCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; |
| | | grdMain.Rows[i].Cells[HGiveAwayFlagCol] = oCell; |
| | | } |
| | | // |
| | | |
| | | DBUtility.Xt_BaseBillFun.initGridLast(sAllowCol, sTotalCol,oSumGrid); |
| | | //---------------------------- |
| | | |
| | | grdSub.ColumnCount = 57; //æ»åæ° |
| | | grdSub.ColumnCount = 60; //æ»åæ° |
| | | DBUtility.Xt_BaseBillFun.initGridFst(grdSub, this.Name); |
| | | grdSub.Columns[HSelectCol].HeaderText = "éæ©"; |
| | | grdSub.Columns[HTMCol].HeaderText = "æ¡ç ç¼å·"; |
| | |
| | | grdSub.Columns[HPinfan2Col].HeaderText = "åçª"; |
| | | grdSub.Columns[HPinfanBarCode2Col].HeaderText = "HPinfanBarCode"; |
| | | grdSub.Columns[HBatchNo2Col].HeaderText = "æ¹å·"; |
| | | grdSub.Columns[HGiveAwayFlag2Col].HeaderText = "æ¯å¦èµ å"; |
| | | grdSub.Columns[HUnitID2Col].HeaderText = "计éåä½ID"; |
| | | grdSub.Columns[HUnitNumber2Col].HeaderText = "计éåä½ä»£ç "; |
| | | grdSub.Columns[HUnitName2Col].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; |
| | |
| | | grdSub.Columns[HSourceID2Col].Visible = false; |
| | | grdSub.Columns[HSourceNumber2Col].Visible = false; |
| | | grdSub.Columns[HSourceName2Col].Visible = false; |
| | | |
| | | //è®¾ç½®ç¹æ®å |
| | | for (int i = 0; i < grdSub.Rows.Count; i++) |
| | | { |
| | | //ç½æ ¼æå¾ |
| | | DataGridViewCheckBoxCell oCell = new DataGridViewCheckBoxCell(); |
| | | oCell.ThreeState = false; |
| | | oCell.Value = 0; |
| | | oCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; |
| | | grdSub.Rows[i].Cells[HGiveAwayFlag2Col] = oCell; |
| | | } |
| | | |
| | | DBUtility.Xt_BaseBillFun.GetGrid(grdMain, this.Name); |
| | | DBUtility.Xt_BaseBillFun.GetGrid(grdSub, this.Name + "grdSub"); |
| | |
| | | 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") |
| | | { |
| | |
| | | grdMain.Rows[i].Cells[HMainIDCol].Value = oTable.Rows[0]["hmainid"].ToString(); |
| | | grdMain.Rows[i].Cells[HSubIDCol].Value = oTable.Rows[0]["hsubid"].ToString(); |
| | | grdMain.Rows[i].Cells[HBillNoCol].Value = oTable.Rows[0]["åæ®å·"].ToString(); |
| | | grdMain.Rows[i].Cells[HSourceBillNoCol].Value = oTable.Rows[0]["åæ®å·"].ToString(); |
| | | grdMain.Rows[i].Cells[HBillTypeCol].Value = oTable.Rows[0]["HBillType"].ToString(); |
| | | grdMain.Rows[i].Cells[HDateCol].Value = oTable.Rows[0]["æ¥æ"].ToString(); |
| | | grdMain.Rows[i].Cells[HDateCol].Value = oTable.Rows[0]["æ¥æ"].ToString(); //忥 æ¶æåæ®æ¥æ |
| | | grdMain.Rows[i].Cells[HShowDateCol].Value = dtpHDate.Value.ToShortDateString(); |
| | | grdMain.Rows[i].Cells[HSupIDCol].Value = oTable.Rows[0]["hsupid"].ToString(); |
| | | grdMain.Rows[i].Cells[HSupNumberCol].Value = oTable.Rows[0]["ä¾åºå代ç "].ToString(); |
| | |
| | | grdMain.Rows[i].Cells[HCusNumberCol].Value = oTable.Rows[0]["客æ·ä»£ç "].ToString(); |
| | | grdMain.Rows[i].Cells[HCusNameCol].Value = oTable.Rows[0]["客æ·"].ToString(); |
| | | grdMain.Rows[i].Cells[HCusTypeCol].Value = oTable.Rows[0]["客æ·åå·"].ToString(); |
| | | grdMain.Rows[i].Cells[HPinfanBarCodeCol].Value = oTable.Rows[0]["HPinfanBarCode"].ToString(); |
| | | grdMain.Rows[i].Cells[HPinfanCol].Value = oTable.Rows[0]["HPinfan"].ToString(); |
| | | //grdMain.Rows[i].Cells[HSourceIDCol].Value = oTable.Rows[0]["HSourceID"].ToString(); |
| | | //grdMain.Rows[i].Cells[HSourceNumberCol].Value = oTable.Rows[0]["ç产线代ç "].ToString(); |
| | | grdMain.Rows[i].Cells[HSourceNameCol].Value = oTable.Rows[0]["ç产线"].ToString(); |
| | | grdMain.Rows[i].Cells[HEndDateCol].Value = oTable.Rows[0]["计åå®å·¥æ¥æ"].ToString(); |
| | | grdMain.Rows[i].Cells[HMinQtyCol].Value = oTable.Rows[0]["æå°å
è£
æ°"].ToString(); |
| | | grdMain.Rows[i].Cells[HEndDateCol].Value = oTable.Rows[0]["计åå®å·¥æ¥æ"].ToString();//忥 ç产订å å¤±ææ¥æ |
| | | if (cmbHBarCodeType.Text == "仪å¨å¤è´ä»¶æ¡ç 容å¨è§å" ) |
| | | { |
| | | grdMain.Rows[i].Cells[HMinQtyCol].Value = ClsPub.isDoule(oTable.Rows[0]["æªçææ¡ç æ°é"]); |
| | | } |
| | | else if (cmbHBarCodeType.Text == "仪å¨å¤è´ä»¶æ¡ç æ®éè§å" |
| | | || cmbHBarCodeType.Text == "ä»ªå¨æåæ¡ç è§å" |
| | | || cmbHBarCodeType.Text == "è¯åæåæ¡ç è§å") |
| | | { |
| | | grdMain.Rows[i].Cells[HMinQtyCol].Value = "1"; |
| | | } |
| | | else |
| | | { |
| | | grdMain.Rows[i].Cells[HMinQtyCol].Value = oTable.Rows[0]["æå°å
è£
æ°"].ToString(); |
| | | } |
| | | //-- |
| | | //设置å¯ç¼è¾å |
| | | string sAllowCol = HQtyCol.ToString() + |
| | | "," + HMinQtyCol.ToString() + |
| | | "," + HAuxPropNumberCol.ToString() + |
| | | "," + HBatchNoCol.ToString() + |
| | | "," + HPackQtyCol.ToString() + |
| | | "," + HRemarkCol.ToString(); |
| | | grdMain.Columns[HBillNoCol].ReadOnly = true; |
| | | //设置å计å |
| | |
| | | grdMain.Rows[i].Cells[HSubIDCol].Value = oTable.Rows[0]["hsubid"].ToString(); |
| | | grdMain.Rows[i].Cells[HBillNoCol].Value = oTable.Rows[0]["åæ®å·"].ToString(); |
| | | grdMain.Rows[i].Cells[HBillTypeCol].Value = oTable.Rows[0]["HBillType"].ToString(); |
| | | grdMain.Rows[i].Cells[HDateCol].Value = oTable.Rows[0]["æ¥æ"].ToString(); |
| | | grdMain.Rows[i].Cells[HDateCol].Value = oTable.Rows[0]["æ¥æ"].ToString(); //忥 åæ®æ¥æ |
| | | grdMain.Rows[i].Cells[HShowDateCol].Value = dtpHDate.Value.ToShortDateString(); |
| | | grdMain.Rows[i].Cells[HDeptIDCol].Value = oTable.Rows[0]["HDeptID"].ToString(); |
| | | grdMain.Rows[i].Cells[HDeptNumberCol].Value = oTable.Rows[0]["é¨é¨ä»£ç "].ToString(); |
| | |
| | | grdMain.Rows[i].Cells[HUnitNameCol].Value = oTable.Rows[0]["计éåä½"].ToString(); |
| | | grdMain.Rows[i].Cells[HRemarkCol].Value = oTable.Rows[0]["夿³¨"].ToString(); |
| | | grdMain.Rows[i].Cells[HMTONoCol].Value = oTable.Rows[0]["计åè·è¸ªå·"].ToString(); |
| | | grdMain.Rows[i].Cells[HMinQtyCol].Value = oTable.Rows[0]["æå°å
è£
æ°"].ToString(); |
| | | if (cmbHBarCodeType.Text == "仪å¨å¤è´ä»¶æ¡ç 容å¨è§å") |
| | | { |
| | | grdMain.Rows[i].Cells[HMinQtyCol].Value = ClsPub.isDoule(oTable.Rows[0]["æªçææ¡ç æ°é"]); |
| | | } |
| | | else if (cmbHBarCodeType.Text == "仪å¨å¤è´ä»¶æ¡ç æ®éè§å") |
| | | { |
| | | grdMain.Rows[i].Cells[HMinQtyCol].Value = "1"; |
| | | } |
| | | else |
| | | { |
| | | grdMain.Rows[i].Cells[HMinQtyCol].Value = oTable.Rows[0]["æå°å
è£
æ°"].ToString(); |
| | | } |
| | | grdMain.Rows[i].Cells[HMakerCol].Value = ClsPub.CurUserName; |
| | | if (cmbSourceBillType.Text.Trim() == "æ¶æéç¥å"|| cmbSourceBillType.Text.Trim() == "éè´è®¢å" |
| | | || cmbSourceBillType.Text.Trim() == "å§å¤è®¢å" || cmbSourceBillType.Text.Trim() == "éè´å
¥åºå") |
| | |
| | | grdMain.Rows[i].Cells[HSupIDCol].Value = oTable.Rows[0]["hsupid"].ToString(); |
| | | grdMain.Rows[i].Cells[HSupNumberCol].Value = oTable.Rows[0]["ä¾åºå代ç "].ToString(); |
| | | grdMain.Rows[i].Cells[HSupNameCol].Value = oTable.Rows[0]["ä¾åºå"].ToString(); |
| | | if (cmbSourceBillType.Text.Trim() == "æ¶æéç¥å") |
| | | { |
| | | if (oTable.Rows[0]["æ¯å¦èµ å"].ToString() == "æ¯") |
| | | { |
| | | grdMain.Rows[i].Cells[HGiveAwayFlagCol].Value = 1; |
| | | } |
| | | else |
| | | { |
| | | 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(); |
| | | } |
| | | |
| | | } |
| | | if (cmbSourceBillType.Text.Trim() == "éè´§éç¥å") |
| | | { |
| | |
| | | #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); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | 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 txtHSourceBillNo_KeyPress(object sender, KeyPressEventArgs e) |
| | | { |
| | | if (e.KeyChar == (char)Keys.Return)//åè½¦å¸¦åºæºåä¿¡æ¯ |
| | | { |
| | | long sHOrgID = -1; |
| | | DAL.ClsGy_ORGANIZATIONS_View oClsGy_ORGANIZATIONS_View = new DAL.ClsGy_ORGANIZATIONS_View(); |
| | | if (oClsGy_ORGANIZATIONS_View.GetInfoByName(cmbHOrgID.Text)) |
| | | { |
| | | sHOrgID = oClsGy_ORGANIZATIONS_View.omodel.HItemID; |
| | | } |
| | | |
| | | if (txtHSourceBillNo.Text.Length < 4) |
| | | { |
| | | MessageBox.Show("请è¾å
¥4ä½ä»¥ä¸æ°æ®ï¼"); |
| | | return; |
| | | } |
| | | //æ ¹æ®æºåç±»å åæºåå· è·åä¿¡æ¯ |
| | | if (cmbSourceBillType.Text.Trim() == "ç产订å") |
| | | { |
| | | DAL.Cls_S_IFCLD_ICMOList oIFCLD_ICMOList = new DAL.Cls_S_IFCLD_ICMOList(); |
| | | if (oIFCLD_ICMOList.RefreshBySourceBillNo(" Where åæ®å· like '%" + txtHSourceBillNo.Text + "' and HOrgID =" + sHOrgID.ToString())) //éæ©åå |
| | | { |
| | | FillSelectData(oIFCLD_ICMOList.oBillSelectColl); |
| | | txtHSourceBillNo.Text = ""; |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("æªæ¥è¯¢å°ä»»å¡æ°æ®ï¼è¯·ç¡®è®¤æéç»ç»ãæºåç±»å䏿ºååå·æ¯å¦æ£ç¡®ï¼"); |
| | | return; |
| | | } |
| | | } |
| | | else if (cmbSourceBillType.Text.Trim() == "çäº§æ±æ¥å") |
| | | { |
| | | DAL.Cls_S_IF_ICMOReportBillList oIF_ICMOReportBillList = new DAL.Cls_S_IF_ICMOReportBillList(); |
| | | if (oIF_ICMOReportBillList.RefreshBySourceBillNo(" Where åæ®å· like '%" + txtHSourceBillNo.Text + "' ")) //éæ©åå |
| | | { |
| | | FillSelectData(oIF_ICMOReportBillList.oBillSelectColl); |
| | | txtHSourceBillNo.Text = ""; |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("æªæ¥è¯¢å°ä»»å¡æ°æ®ï¼è¯·ç¡®è®¤æéç»ç»ãæºåç±»å䏿ºååå·æ¯å¦æ£ç¡®ï¼"); |
| | | return; |
| | | } |
| | | } |
| | | else if (cmbSourceBillType.Text.Trim() == "æ¶æéç¥å") |
| | | { |
| | | DAL.Cls_S_IF_POInStockBillList oIF_POInStockBillList = new DAL.Cls_S_IF_POInStockBillList(); |
| | | if (oIF_POInStockBillList.RefreshBySourceBillNo(" Where åæ®å· like '%" + txtHSourceBillNo.Text + "' ")) //éæ©åå |
| | | { |
| | | FillSelectData(oIF_POInStockBillList.oBillSelectColl); |
| | | txtHSourceBillNo.Text = ""; |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("æªæ¥è¯¢å°ä»»å¡æ°æ®ï¼è¯·ç¡®è®¤æéç»ç»ãæºåç±»å䏿ºååå·æ¯å¦æ£ç¡®ï¼"); |
| | | return; |
| | | } |
| | | } |
| | | else if (cmbSourceBillType.Text.Trim() == "éè´è®¢å") |
| | | { |
| | | DAL.Cls_S_IF_POOrderBillList oIF_POOrderBillList = new DAL.Cls_S_IF_POOrderBillList(); |
| | | if (oIF_POOrderBillList.RefreshBySourceBillNo(" Where åæ®å· like '%" + txtHSourceBillNo.Text + "' ")) //éæ©åå |
| | | { |
| | | FillSelectData(oIF_POOrderBillList.oBillSelectColl); |
| | | txtHSourceBillNo.Text = ""; |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("æªæ¥è¯¢å°ä»»å¡æ°æ®ï¼è¯·ç¡®è®¤æéç»ç»ãæºåç±»å䏿ºååå·æ¯å¦æ£ç¡®ï¼"); |
| | | return; |
| | | } |
| | | } |
| | | else if (cmbSourceBillType.Text.Trim() == "å§å¤è®¢å") |
| | | { |
| | | DAL.Cls_S_IF_EntrustOrderBillList oIF_EntrustOrderBillList = new DAL.Cls_S_IF_EntrustOrderBillList(); |
| | | if (oIF_EntrustOrderBillList.RefreshBySourceBillNo(" Where åæ®å· like '%" + txtHSourceBillNo.Text + "' ")) //éæ©åå |
| | | { |
| | | FillSelectData(oIF_EntrustOrderBillList.oBillSelectColl); |
| | | txtHSourceBillNo.Text = ""; |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("æªæ¥è¯¢å°ä»»å¡æ°æ®ï¼è¯·ç¡®è®¤æéç»ç»ãæºåç±»å䏿ºååå·æ¯å¦æ£ç¡®ï¼"); |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("æéæºåç±»åï¼ä¸æ¯ææ¤åè½ï¼"); |
| | | return; |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | //çæå¤ç®±ç |
| | | private void wxm_Click(object sender, EventArgs e) |
| | | { |
| | | try |
| | | { |
| | | 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; //å¤ç®±ç åç¼ |
| | | |
| | | //å¿
é¡»æ¡ç çææé®æ¯ç°åº¦æå¯ä»¥çæç®±æ¡ç |
| | | 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 ); |
| | | } |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | } |
| | | } |
| | | } |