| | |
| | | string HModelName = ""; //æºå |
| | | string HICMOBillNo = ""; //æºåå· |
| | | string HBarCodeBatchNo = ""; //æ¡ç æ¹æ¬¡å· |
| | | string HBarCodeDate = ""; //æ¡ç æ¥æ |
| | | int k = 0; |
| | | int n = 0; //å䏿¹çææ¡ç ä¸çç¬¬å æ¡ |
| | | string sTMNumber = ""; //æ¡ç èªå®ä¹åç¼ |
| | |
| | | { |
| | | sDate = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HEndDateCol].Value); |
| | | } |
| | | else if (CompanyName=="å¤å®çµå¨")// æ¥æï¼çäº§è®¢å æ¡ç æ¥æ |
| | | 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[HMaterModelCol].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(); |
| | |
| | | { |
| | | //å¶é æ¬é¨1ä½ï¼é»è®¤1ï¼+æºå代ç 5ä½ï¼ï¼+å¹´2ä½+æ1ä½ï¼AãBãC代æ¿10æä»½ï¼ |
| | | //+æ¥2ä½+æ¡ç æ¹æ¬¡ç 2ä½+å缩æºä»£ç 1ä½+00+æµæ°´å·4ä½+æ ¡éªç ï¼é»è®¤0ï¼ |
| | | sTMNumber = "1" + HModelName + sYear + Sub_PeriodChange(sPeriod) + sDay + HBarCodeBatchNo + HYasuoji + "00" ; |
| | | 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 = 4; |
| | | if (sTMNumber.Length != 16) |
| | | { |
| | | MessageBox.Show("æ¡ç é¿åº¦ä¸å¤16ä½ï¼æ¯å¦æ°æ®ä¸å
¨ï¼"); |
| | | return; |
| | | } |
| | | } |
| | | else if (cmbHBarCodeType.Text == "å¤éæºæ¡ç ") |
| | | { |
| | | //ç©æä»£ç 11ä½+å¹´2ä½+æ1ä½ï¼AãBãC代æ¿10æä»½ï¼+æ¥2ä½+æ¹æ¬¡2ä½+æµæ°´å·4ä½ |
| | | sTMNumber = HMaterNumber + sYear + Sub_PeriodChange(sPeriod) + sDay + HBarCodeBatchNo ; |
| | | //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.isInt(Ds.Tables[0].Rows[0][0]); |
| | | LSHlen = 4; |
| | | if (sTMNumber.Length != 18) |
| | | { |
| | | MessageBox.Show("æ¡ç é¿åº¦ä¸å¤16ä½ï¼æ¯å¦æ°æ®ä¸å
¨ï¼"); |
| | | return; |
| | | } |
| | | } |
| | | else if (cmbHBarCodeType.Text == "åæåæ¡ç ") |
| | | { |
| | |
| | | || cmbHBarCodeType.Text == "åæåæ¡ç " || cmbHBarCodeType.Text == "å¤éæºæ¡ç ") |
| | | { |
| | | TM = sTMNumber + LSH2; |
| | | |
| | | } |
| | | else if (cmbHBarCodeType.Text == "å
éæºæ¡ç ") |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | //æä»½è½¬å |
| | | 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(2, 1); |
| | | } |
| | | } |
| | | ////æä»½è½¬å |
| | | //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); |
| | | // } |
| | | //} |
| | | |
| | | |
| | | //çææ¡ç 忥 |
| | |
| | | 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[HShowDateCol].Value = dtpHDate.Value.ToShortDateString(); |
| | |
| | | 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(); |