| | |
| | | cmbSourceBillType.Items.Add("éè´è®¢å"); |
| | | cmbSourceBillType.Items.Add("æ¶æéç¥å"); |
| | | cmbSourceBillType.Items.Add("å§å¤è®¢å"); |
| | | cmbSourceBillType.Items.Add("å·¥åºæ±æ¥å"); |
| | | cmbSourceBillType.Items.Add("å·¥åºæµè½¬å¡"); |
| | | cmbSourceBillType.Items.Add("éè´§éç¥å"); |
| | | cmbSourceBillType.Items.Add("å
¶ä»å
¥åºå"); |
| | | cmbSourceBillType.Items.Add("ç´æ¥è°æ¨å"); |
| | |
| | | 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) |
| | |
| | | LSH2 = "0" + LSH2; |
| | | } |
| | | if (cmbHBarCodeType.Text == "å¯ä¸æ¡ç ") |
| | | { |
| | | //æ¡ç ç¼å· = æ¡ç åç¼ + æµæ°´å· |
| | | TM = sTMNumber + LSH2; |
| | | } |
| | | else if (cmbHBarCodeType.Text == "åºåç ") |
| | | { |
| | | //æ¡ç ç¼å· = æ¡ç åç¼ + æµæ°´å· |
| | | TM = sTMNumber + LSH2; |
| | |
| | | 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 = ""; //å°¾æ° |
| | |
| | | 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; |
| | |
| | | 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 |
| | | { |
| | | |
| | |
| | | grdMain.Rows[i].Cells[HTagCol].Value = "*"; |
| | | //å¾å°ä¿¡æ¯ |
| | | Ds = oCn.RunProcReturn("select * from h_v_IF_PackageDismantleList where hmainid=" + oSelectRow.BillMainID + " and hsubid=" + oSelectRow.BillSubID, "h_v_IF_PackageDismantleList"); |
| | | //åå
¥ä¿¡æ¯ |
| | | 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); |
| | | } |
| | |
| | | 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); |
| | |
| | | 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; |
| | | } |
| | | } |
| | | } |
| | | } |