| | |
| | | public const Int16 HCusModelCol = 46; |
| | | // |
| | | public string ModName = "85"; |
| | | public string ModCaption = "浪潮ãå
èãé¡ºè¾¾å®¢æ·æ ç¾çæ"; |
| | | public string ModCaption = "浪潮ãå
èã顺达ãç«è®¯å®¢æ·æ ç¾çæ"; |
| | | public const string ModRightName = "Gy_CusBarCodeBill_KaiBei_LangChao"; |
| | | |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | |
| | | public Int64 HOrgID = ClsPub.HOrgID; |
| | | public string HCS = "Z"; //åå代ç |
| | | public string sDate = ""; //æ¥æ |
| | | public string sYear = ""; //å¹´ï¼2ä½ï¼ |
| | | public string sYear = ""; //å¹´ |
| | | public string sYear2 = ""; //å¹´ï¼2ä½ï¼ |
| | | public string sYear4 = ""; //å¹´ï¼4ä½ï¼ |
| | | public string sPeriod = ""; //æ |
| | | public string sPeriod2 = ""; //æï¼æ£å¸¸ï¼ |
| | |
| | | //æ¥æè·åæ¹å¼ |
| | | sDate = dtpHDate.Value.ToShortDateString(); |
| | | sYear = ClsPub.isDate(sDate).Year.ToString().Substring(2, 2); |
| | | sYear2 = ClsPub.isDate(sDate).Year.ToString().Substring(2, 2); |
| | | sYear4 = ClsPub.isDate(sDate).Year.ToString(); |
| | | sPeriod = "0" + ClsPub.isDate(sDate).Month.ToString(); |
| | | sPeriod = sPeriod.Substring(sPeriod.Length - 2, 2); |
| | |
| | | double HWMinQty = DBUtility.ClsPub.isDoule(grdMain.Rows[j].Cells[HWMinQtyCol].Value); // å¤ç®±æå°å
è£
æ° |
| | | string HCusModelName = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HCusModelNameCol].Value); // å®¢æ·æå· |
| | | string HCode1 = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HCode1Col].Value); // ç©æç±»å« |
| | | if (cmbHCusName.Text.Contains("è¾¾åç²¾å¯æºé ")) |
| | | { |
| | | HCode1 = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HBatchNoCol].Value); // æ¹å· |
| | | } |
| | | string HCode2 = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HCode2Col].Value); // æ¹æ¬¡ä½ |
| | | HCode2 = HCode2.ToUpper(); |
| | | string HCode3 = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HCode3Col].Value); // çæ¬å· |
| | |
| | | long sHMaterID = DBUtility.ClsPub.isLong(grdMain.Rows[j].Cells[HMaterIDCol].Value); // ç©æå
ç |
| | | string sHMaterNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HMaterNumberCol].Value); // ç©æä»£ç |
| | | string sHCusModelName = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HCusModelNameCol].Value); // å®¢æ·æå· |
| | | string sHCode1 = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HCode1Col].Value); // ç©æç±»å« |
| | | string sHCode2 = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HCode2Col].Value); // æ¹æ¬¡ä½ |
| | | sHCode2 = sHCode2.ToUpper(); |
| | | string HBatchNoNumber = sHCode1 + sYear + sPeriod + sDay + HCS; // æ¹æ¬¡çæåç¼ |
| | | HBatchNoNumber = HBatchNoNumber.ToUpper(); |
| | | |
| | | DataSet oDsBatchNo = oCn.RunProcReturn("exec h_p_Gy_CusBarCodeBill_KaiBeiLC_GetBatchNo '" + sHSourceBillNo + "'," + sHMaterID.ToString() + ",'" + sHMaterNumber + "','" + sHCusModelName + "','" + sHCode2 + "','" + HBatchNoNumber + "'", "h_p_Gy_CusBarCodeBill_KaiBeiLC_GetBatchNo"); |
| | | // |
| | | if (oDsBatchNo == null && oDsBatchNo.Tables[0].Rows.Count == 0) |
| | | if (cmbHCusName.Text.Contains("è¾¾åç²¾å¯æºé ")) |
| | | { |
| | | MessageBox.Show("è·åæ¹æ¬¡å¤±è´¥ï¼"); |
| | | bc.Enabled = true; |
| | | oCn.RollBack(); |
| | | return; |
| | | //è·åæå¤§æµæ°´å· |
| | | //æ¡ç åç¼ = 客æ·ç©æå¯¹åºè¡¨ä¸å®¢æ·äº§åç¼ç +ä¾åºå代ç ï¼åºå®'0001010121'ï¼+å¹´ææ¥ï¼YYMMDDï¼ |
| | | sTMNumber = sHCusModelName + "0001010121" + sYear2 + sPeriod2 + 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 (DBUtility.ClsPub.isStrNull(oDsBatchNo.Tables[0].Rows[0][0]) == "1") |
| | | { |
| | | MessageBox.Show(DBUtility.ClsPub.isStrNull(oDsBatchNo.Tables[0].Rows[0]["HRemark"])); |
| | | bc.Enabled = true; |
| | | oCn.RollBack(); |
| | | return; |
| | | } |
| | | //浪潮ãå
èã顺达 |
| | | else |
| | | { |
| | | grdMain.Rows[j].Cells[HBaNoCol].Value = sHCode2; |
| | | grdMain.Rows[j].Cells[HBatchNoCol].Value = DBUtility.ClsPub.isStrNull(oDsBatchNo.Tables[0].Rows[0]["HBatchNo"]); |
| | | grdMain.Rows[j].Cells[HCode2Col].Value = DBUtility.ClsPub.isStrNull(oDsBatchNo.Tables[0].Rows[0]["HCode2"]); |
| | | } |
| | | string sHCode1 = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HCode1Col].Value); // ç©æç±»å« |
| | | string sHCode2 = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HCode2Col].Value); // æ¹æ¬¡ä½ |
| | | sHCode2 = sHCode2.ToUpper(); |
| | | string HBatchNoNumber = sHCode1 + sYear + sPeriod + sDay + HCS; // æ¹æ¬¡çæåç¼ |
| | | HBatchNoNumber = HBatchNoNumber.ToUpper(); |
| | | |
| | | HBatchNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HBatchNoCol].Value); |
| | | HCode3 = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HCode3Col].Value); |
| | | //è·åæå¤§æµæ°´å· |
| | | LSH = 0; |
| | | Ds = oCn.RunProcReturn("select top 1 HSno from Gy_BarCodeBill_Cus where HBatchNo='" + HBatchNo + "' order by HSno desc", "Gy_BarCodeBill_Cus"); |
| | | if (Ds != null && Ds.Tables[0].Rows.Count != 0) |
| | | { |
| | | LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); |
| | | DataSet oDsBatchNo = oCn.RunProcReturn("exec h_p_Gy_CusBarCodeBill_KaiBeiLC_GetBatchNo '" + sHSourceBillNo + "'," + sHMaterID.ToString() + ",'" + sHMaterNumber + "','" + sHCusModelName + "','" + sHCode2 + "','" + HBatchNoNumber + "'", "h_p_Gy_CusBarCodeBill_KaiBeiLC_GetBatchNo"); |
| | | // |
| | | if (oDsBatchNo == null && oDsBatchNo.Tables[0].Rows.Count == 0) |
| | | { |
| | | MessageBox.Show("è·åæ¹æ¬¡å¤±è´¥ï¼"); |
| | | bc.Enabled = true; |
| | | oCn.RollBack(); |
| | | return; |
| | | } |
| | | else if (DBUtility.ClsPub.isStrNull(oDsBatchNo.Tables[0].Rows[0][0]) == "1") |
| | | { |
| | | MessageBox.Show(DBUtility.ClsPub.isStrNull(oDsBatchNo.Tables[0].Rows[0]["HRemark"])); |
| | | bc.Enabled = true; |
| | | oCn.RollBack(); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | grdMain.Rows[j].Cells[HBaNoCol].Value = sHCode2; |
| | | grdMain.Rows[j].Cells[HBatchNoCol].Value = DBUtility.ClsPub.isStrNull(oDsBatchNo.Tables[0].Rows[0]["HBatchNo"]); |
| | | grdMain.Rows[j].Cells[HCode2Col].Value = DBUtility.ClsPub.isStrNull(oDsBatchNo.Tables[0].Rows[0]["HCode2"]); |
| | | } |
| | | |
| | | HBatchNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HBatchNoCol].Value); |
| | | HCode3 = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HCode3Col].Value); |
| | | //è·åæå¤§æµæ°´å· |
| | | LSH = 0; |
| | | Ds = oCn.RunProcReturn("select top 1 HSno from Gy_BarCodeBill_Cus where HBatchNo='" + HBatchNo + "' order by HSno desc", "Gy_BarCodeBill_Cus"); |
| | | if (Ds != null && Ds.Tables[0].Rows.Count != 0) |
| | | { |
| | | LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); |
| | | } |
| | | } |
| | | |
| | | HBQty = ClsPub.isInt(grdMain.Rows[j].Cells[HBQtyCol].Value); |
| | |
| | | { |
| | | LSH2 = "0" + LSH2; |
| | | } |
| | | //æ¡ç ç¼å· = æ¹æ¬¡ + æµæ°´å· + çæ¬å· |
| | | TM = HBatchNo + LSH2 + HCode3; |
| | | |
| | | HEntryID = j + 1; |
| | | HBarCode = TM.ToUpper(); |
| | | if(cmbHCusName.Text.Contains("å
è")) |
| | | if (cmbHCusName.Text.Contains("è¾¾åç²¾å¯æºé ")) |
| | | { |
| | | TM = sTMNumber + LSH2; |
| | | HBarCodeType = "ç«è®¯å
ç®±ç "; |
| | | HSno = 0; |
| | | } |
| | | else if (cmbHCusName.Text.Contains("å
è")) |
| | | { |
| | | //æ¡ç ç¼å· = æ¹æ¬¡ + æµæ°´å· + çæ¬å· |
| | | TM = HBatchNo + LSH2 + HCode3; |
| | | HBarCodeType = "å
èå
ç®±ç "; |
| | | HSno = LSH; |
| | | } |
| | | else if (cmbHCusName.Text.Contains("顺达")) |
| | | { |
| | | //æ¡ç ç¼å· = æ¹æ¬¡ + æµæ°´å· + çæ¬å· |
| | | TM = HBatchNo + LSH2 + HCode3; |
| | | HBarCodeType = "顺达å
ç®±ç "; |
| | | HSno = LSH; |
| | | } |
| | | else |
| | | { |
| | | //æ¡ç ç¼å· = æ¹æ¬¡ + æµæ°´å· + çæ¬å· |
| | | TM = HBatchNo + LSH2 + HCode3; |
| | | HBarCodeType = "å
ç®±ç "; |
| | | HSno = LSH; |
| | | } |
| | | |
| | | HEntryID = j + 1; |
| | | HBarCode = TM.ToUpper(); |
| | | HMaterID = ClsPub.isLong(grdMain.Rows[j].Cells[HMaterIDCol].Value); |
| | | HUnitID = ClsPub.isLong(grdMain.Rows[j].Cells[HUnitIDCol].Value); |
| | | HAuxPropID = ClsPub.isLong(grdMain.Rows[j].Cells[HAuxPropIDCol].Value); |
| | |
| | | HCode1 = ClsPub.isStrNull(grdMain.Rows[j].Cells[HCode1Col].Value).ToUpper(); |
| | | HCode2 = ClsPub.isStrNull(grdMain.Rows[j].Cells[HCode2Col].Value).ToUpper(); |
| | | HCode3 = ClsPub.isStrNull(grdMain.Rows[j].Cells[HCode3Col].Value).ToUpper(); |
| | | HSno = LSH; |
| | | HBoxNo = HCode1 + sYear + sPeriod + sDay + HCS; |
| | | HBoxNo = HBoxNo.ToUpper(); |
| | | sHBaNo = ClsPub.isStrNull(grdMain.Rows[j].Cells[HBaNoCol].Value); // çé¢ä¸è¾å
¥çæ¹æ¬¡ä½ |
| | |
| | | { |
| | | HBatchNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HBatchNoCol].Value); |
| | | HCode3 = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[HCode3Col].Value); |
| | | HCusModelName = ClsPub.isStrNull(grdMain.Rows[j].Cells[HCusModelNameCol].Value); |
| | | if (cmbHCusName.Text.Contains("å
è")) |
| | | { |
| | | LWSHlen = 5; |
| | |
| | | Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· |
| | | LWSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); |
| | | } |
| | | else if (cmbHCusName.Text.Contains("è¾¾åç²¾å¯æºé ")) |
| | | { |
| | | LWSHlen = 6; |
| | | HBarCodeType = "ç«è®¯å¤ç®±ç "; |
| | | //è·åæå¤§æµæ°´å· |
| | | //æ¡ç åç¼ = 客æ·ç©æå¯¹åºè¡¨ä¸å®¢æ·äº§åç¼ç +å¹´ææ¥ï¼YYMMDDï¼ |
| | | sTMNumber = HCusModelName + sYear2 + sPeriod2 + sDay; |
| | | Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· |
| | | LWSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); |
| | | } |
| | | //浪潮 |
| | | else |
| | | { |
| | | LWSHlen = 5; |
| | |
| | | HAuxPropID = ClsPub.isLong(grdMain.Rows[j].Cells[HAuxPropIDCol].Value); |
| | | HQty = HWMinQty; |
| | | HCusID = ClsPub.isLong(cmbHCusName.SelectedValue); |
| | | HCusModelName = ClsPub.isStrNull(grdMain.Rows[j].Cells[HCusModelNameCol].Value); |
| | | HCusModel = ClsPub.isStrNull(grdMain.Rows[j].Cells[HCusModelCol].Value); |
| | | HGiveAwayFlag = ClsPub.isBool(grdMain.Rows[j].Cells[HGiveAwayFlagCol].Value); |
| | | HISKFPERIOD = ClsPub.isBool(grdMain.Rows[j].Cells[HISKFPERIODCol].Value); |
| | |
| | | private void Display() |
| | | { |
| | | //å·æ°å
ç®±ç å表 |
| | | DataSet DSet = oCn.RunProcReturn("select * from h_v_Gy_BarCodeBill_CusList where HInterID=" + HInterID.ToString() + " and (æ¡ç ç±»å='å
ç®±ç ' or æ¡ç ç±»å='å
èå
ç®±ç ' or æ¡ç ç±»å='顺达å
ç®±ç ') order by HItemID", "h_v_Gy_BarCodeBill_CusList", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | DataSet DSet = oCn.RunProcReturn("select * from h_v_Gy_BarCodeBill_CusList where HInterID=" + HInterID.ToString() + " and æ¡ç ç±»å in ('å
ç®±ç ','å
èå
ç®±ç ','顺达å
ç®±ç ','ç«è®¯å
ç®±ç ') order by HItemID", "h_v_Gy_BarCodeBill_CusList", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //çæé¦è¡æ é¢ |
| | | if (DSet == null) |
| | | { |
| | |
| | | grdSub.DataSource = DSet.Tables[0].DefaultView; |
| | | |
| | | //å·æ°å¤ç®±ç å表 |
| | | DataSet DWSet = oCn.RunProcReturn("select * from h_v_Gy_BarCodeBill_CusList where HInterID=" + HInterID.ToString() + " and (æ¡ç ç±»å='å¤ç®±ç ' or æ¡ç ç±»å='å
èå¤ç®±ç ' or æ¡ç ç±»å='顺达å¤ç®±ç ') order by HItemID", "h_v_Gy_BarCodeBill_CusList", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | DataSet DWSet = oCn.RunProcReturn("select * from h_v_Gy_BarCodeBill_CusList where HInterID=" + HInterID.ToString() + " and æ¡ç ç±»å in ('å¤ç®±ç ','å
èå¤ç®±ç ','顺达å¤ç®±ç ','ç«è®¯å¤ç®±ç ') order by HItemID", "h_v_Gy_BarCodeBill_CusList", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //çæé¦è¡æ é¢ |
| | | if (DWSet == null) |
| | | { |
| | |
| | | grdMain.Rows[i].Cells[HEXPPERIODCol].Value = oTable.Rows[0]["HEXPPERIOD"].ToString(); |
| | | grdMain.Rows[i].Cells[HInnerBillNoCol].Value = oTable.Rows[0]["éå®è®¢åç¼å·"].ToString(); |
| | | //-- |
| | | //设置å¯ç¼è¾å |
| | | string sAllowCol = HQtyCol.ToString() + |
| | | "," + HMinQtyCol.ToString() + |
| | | "," + HWMinQtyCol.ToString() + |
| | | "," + HAuxPropNumberCol.ToString() + |
| | | "," + HCusModelNameCol.ToString() + |
| | | "," + HCusModelCol.ToString() + |
| | | //"," + HCode1Col.ToString() + |
| | | //"," + HCode2Col.ToString() + |
| | | //"," + HCode3Col.ToString() + |
| | | "," + HInnerBillNoCol.ToString() + |
| | | "," + HRemarkCol.ToString(); |
| | | string sAllowCol = HRemarkCol.ToString(); |
| | | if (cmbHCusName.Text.Contains("è¾¾åç²¾å¯æºé ")) |
| | | { |
| | | sAllowCol = HQtyCol.ToString() + |
| | | "," + HMinQtyCol.ToString() + |
| | | "," + HWMinQtyCol.ToString() + |
| | | "," + HAuxPropNumberCol.ToString() + |
| | | "," + HCusModelNameCol.ToString() + |
| | | "," + HCusModelCol.ToString() + |
| | | "," + HBatchNoCol.ToString() + |
| | | "," + HInnerBillNoCol.ToString() + |
| | | "," + HRemarkCol.ToString(); |
| | | } |
| | | else |
| | | { |
| | | //设置å¯ç¼è¾å |
| | | sAllowCol = HQtyCol.ToString() + |
| | | "," + HMinQtyCol.ToString() + |
| | | "," + HWMinQtyCol.ToString() + |
| | | "," + HAuxPropNumberCol.ToString() + |
| | | "," + HCusModelNameCol.ToString() + |
| | | "," + HCusModelCol.ToString() + |
| | | //"," + HCode1Col.ToString() + |
| | | //"," + HCode2Col.ToString() + |
| | | //"," + HCode3Col.ToString() + |
| | | "," + HInnerBillNoCol.ToString() + |
| | | "," + HRemarkCol.ToString(); |
| | | } |
| | | grdMain.Columns[HBillNoCol].ReadOnly = true; |
| | | //设置å计å |
| | | string sTotalCol = HQtyCol.ToString(); |
| | |
| | | { |
| | | try |
| | | { |
| | | oCn.RunProc("update Gy_BarCodeBill_Cus set HPrintQty=isnull(HPrintQty,0)+1 where HBarCodeType in ('å
ç®±ç ','å
èå
ç®±ç ','顺达å
ç®±ç ') and HInterID=" + HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCn.RunProc("update Gy_BarCodeBill_Cus set HPrintQty=isnull(HPrintQty,0)+1 where HBarCodeType in ('å
ç®±ç ','å
èå
ç®±ç ','顺达å
ç®±ç ','ç«è®¯å
ç®±ç ') and HInterID=" + HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | { |
| | | try |
| | | { |
| | | oCn.RunProc("update Gy_BarCodeBill_Cus set HPrintQty=isnull(HPrintQty,0)+1 where HBarCodeType in ('å¤ç®±ç ','å
èå¤ç®±ç ','顺达å¤ç®±ç ') and HInterID=" + HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCn.RunProc("update Gy_BarCodeBill_Cus set HPrintQty=isnull(HPrintQty,0)+1 where HBarCodeType in ('å¤ç®±ç ','å
èå¤ç®±ç ','顺达å¤ç®±ç ','ç«è®¯å¤ç®±ç ') and HInterID=" + HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | catch (Exception e) |
| | | { |