| | |
| | | public Int64 HInterID_TTM = 0; |
| | | public string HBillNo_TTM = ""; |
| | | ClsCN SubCn = new ClsCN(); |
| | | Pub_Class.ClsGridViewSum oSumGrid = new Pub_Class.ClsGridViewSum(); |
| | | // |
| | | private void initGrid() |
| | | { |
| | |
| | | { |
| | | // |
| | | //frmCondition = new frmBillQueryCondition_New(); |
| | | oSumGrid.ogrdMain = grdMain; |
| | | this.Text = ModCaption; |
| | | //lblCaption.Text = ModCaption; |
| | | initGrid(); |
| | |
| | | string WeiShu = ""; //å°¾æ° |
| | | int LSHlen = 6; //æµæ°´å·é¿åº¦ |
| | | string TM = ""; //æ¡ç |
| | | string sPackBarCode = ""; |
| | | //HDate = dtpHBeginDate.Value.ToShortDateString(); |
| | | //HYear = ClsPub.isDate(HDate).Year.ToString().Substring(2, 2); |
| | | //HPeriod = "0" + ClsPub.isDate(HDate).Month.ToString(); |
| | | //HPeriod = HPeriod.Substring(HPeriod.Length - 2, 2); |
| | | //HDay = "0" + ClsPub.isDate(HDate).Day.ToString(); |
| | | //HDay = HDay.Substring(HDay.Length - 2, 2); |
| | | |
| | | HDate = dtpHBeginDate.Value.ToShortDateString(); |
| | | HYear = ClsPub.isDate(HDate).Year.ToString().Substring(2, 2); |
| | | HPeriod = "0" + ClsPub.isDate(HDate).Month.ToString(); |
| | | HPeriod = HPeriod.Substring(HPeriod.Length - 2, 2); |
| | | HDay = "0" + ClsPub.isDate(HDate).Day.ToString(); |
| | | HDay = HDay.Substring(HDay.Length - 2, 2); |
| | | HDate = dtpHBeginDate.Value.ToShortDateString(); |
| | | DataSet DSet1 = oCn.RunProcReturn("select * from Gy_FactoryDayOff Where HFactoryDayOffDate='" + HDate.ToString() + "'", "Gy_FactoryDayOff", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //çæé¦è¡æ é¢ |
| | | if (DSet1 == null || DSet1.Tables[0].Rows.Count == 0) |
| | | { |
| | | HDate = DateTime.Now.ToShortDateString(); |
| | | HYear = ClsPub.isDate(HDate).Year.ToString().Substring(2, 2); |
| | | HPeriod = "0" + ClsPub.isDate(HDate).Month.ToString(); |
| | | HPeriod = HPeriod.Substring(HPeriod.Length - 2, 2); |
| | | HDay = "0" + ClsPub.isDate(HDate).Day.ToString(); |
| | | HDay = HDay.Substring(HDay.Length - 2, 2); |
| | | long HTMaterID = 0; |
| | | HTMaterID = ClsPub.isLong(grdMain.Rows[0].Cells[Fun_GetCol("HMaterID")].Value); |
| | | string sPackStr = "ZXM" + HYear + HPeriod + HDay + HTMaterID; //å¤ç®±ç åç¼ |
| | | DataSet DsTM = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sPackStr + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); |
| | | Int64 TTM_LSH = ClsPub.isInt(DsTM.Tables[0].Rows[0][0]) + 1; |
| | | sPackBarCode = sPackStr + TTM_LSH.ToString(); |
| | | oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sPackStr + "'"); |
| | | } |
| | | else |
| | | { |
| | | HDate = DBUtility.ClsPub.isStrNull(DSet1.Tables[0].Rows[0]["HNoFactoryDayOffDate"]); |
| | | HYear = ClsPub.isDate(HDate).Year.ToString().Substring(2, 2); |
| | | HPeriod = "0" + ClsPub.isDate(HDate).Month.ToString(); |
| | | HPeriod = HPeriod.Substring(HPeriod.Length - 2, 2); |
| | | HDay = "0" + ClsPub.isDate(HDate).Day.ToString(); |
| | | HDay = HDay.Substring(HDay.Length - 2, 2); |
| | | long HTMaterID = 0; |
| | | HTMaterID = ClsPub.isLong(grdMain.Rows[0].Cells[Fun_GetCol("HMaterID")].Value); |
| | | string sPackStr = "ZXM" + HYear + HPeriod + HDay + HTMaterID; //å¤ç®±ç åç¼ |
| | | DataSet DsTM = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sPackStr + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); |
| | | Int64 TTM_LSH = ClsPub.isInt(DsTM.Tables[0].Rows[0][0]) + 1; |
| | | sPackBarCode = sPackStr + TTM_LSH.ToString() + "+" ; |
| | | oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sPackStr + "'"); |
| | | } |
| | | |
| | | //=============æ ¹æ®çé¢ä¸å·²ç»åé
çæ°æ®è¿è¡æ¡ç çæåæå°ã |
| | | //è·åæ¬æ¬¡çæç 主å
ç |
| | |
| | | //00 å
çæ å¯ä¸ç ææ¡ç |
| | | |
| | | //çæä¸ä¸ªå¤ç®±ç |
| | | long HTMaterID = 0; |
| | | HTMaterID = ClsPub.isLong(grdMain.Rows[0].Cells[Fun_GetCol("HMaterID")].Value); |
| | | string sPackStr = "ZXM" + HYear + HPeriod + HDay + HTMaterID; //å¤ç®±ç åç¼ |
| | | DataSet DsTM = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sPackStr + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); |
| | | Int64 TTM_LSH = ClsPub.isInt(DsTM.Tables[0].Rows[0][0]) + 1; |
| | | string sPackBarCode = sPackStr + TTM_LSH.ToString(); |
| | | oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sPackStr + "'"); |
| | | //long HTMaterID = 0; |
| | | //HTMaterID = ClsPub.isLong(grdMain.Rows[0].Cells[Fun_GetCol("HMaterID")].Value); |
| | | //string sPackStr = "ZXM" + HYear + HPeriod + HDay + HTMaterID; //å¤ç®±ç åç¼ |
| | | //DataSet DsTM = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sPackStr + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); |
| | | //Int64 TTM_LSH = ClsPub.isInt(DsTM.Tables[0].Rows[0][0]) + 1; |
| | | //string sPackBarCode = sPackStr + TTM_LSH.ToString(); |
| | | //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sPackStr + "'"); |
| | | |
| | | |
| | | //MessageBox.Show("11"); |
| | |
| | | } |
| | | //2.循ç¯ç»æåï¼æ ¹æ® æ¬æ¬¡çæç 主å
ç ï¼ä»åå°æ°æ®åºè·å æ¡ç å表ï¼çæ ç»æå å ææ¡ç ï¼ ç´æ¥è°ç¨åå¨è¿ç¨ |
| | | //æ ¹æ®å¤ç®±ç åå
¥ ç»æå主表ï¼ç»æåå表ï¼SUMï¼å¤ç®±ç æ¡£æ¡ï¼SUMæ¡£æ¡ |
| | | oCn.RunProc("exec h_p_WMS_PackUnionBill_AddNew '" + sPackBarCode + "'," + HInterID_TTM.ToString() + ",'" + DBUtility.ClsPub.CurUserName + "'," + HInterID.ToString()); //æ ¹æ®ç®±æ¡ç ï¼åå
¥ 主表ï¼å表 ï¼ç®±æ¡ç æ¡£æ¡ |
| | | oCn.RunProc("exec h_p_WMS_PackUnionBill_AddNew '" + sPackBarCode + "'," + HInterID_TTM.ToString() + ",'" + DBUtility.ClsPub.CurUserName + "','" + HDate + "'," + HInterID.ToString()); //æ ¹æ®ç®±æ¡ç ï¼åå
¥ 主表ï¼å表 ï¼ç®±æ¡ç æ¡£æ¡ |
| | | oCn.RunProc("exec h_p_WMS_PackUnionBill_SumSubBill " + HInterID_TTM.ToString() + ",'" + sPackBarCode + "','3783','" + DBUtility.ClsPub.CurUserName + "'," + HInterID.ToString()); //æ ¹æ®ç®±æ¡ç ï¼åå
¥ SUM表ï¼SUMæ¡ç æ¡£æ¡ |
| | | |
| | | |
| | |
| | | |
| | | bool flag = this.txtHZXQty.Text.Trim() != ""; |
| | | double num; |
| | | double HICMOQty = 0; |
| | | if (flag) |
| | | { |
| | | num = Pub_Class.ClsPub.isDoule(this.txtHZXQty.Text); |
| | |
| | | { |
| | | for (int i = 0; i < this.grdMain.Rows.Count; i++) |
| | | { |
| | | for (int i1 = 0; i1 < this.grdMain.Rows.Count; i1++) |
| | | { |
| | | |
| | | HICMOQty += Pub_Class.ClsPub.isDoule(this.grdMain.Rows[i1].Cells["çäº§è®¢åæ°é"].Value); |
| | | } |
| | | if (HICMOQty < num) |
| | | { |
| | | MessageBox.Show("请ç¹å»è¶
é¢ç产æé®çææ¡ç ï¼"); |
| | | break; |
| | | } |
| | | |
| | | bool flag3 = num > 0.0; |
| | | if (!flag3) |
| | | { |
| | |
| | | } |
| | | if (cmbHBarCodeType.Text == "å¯ä¸æ¡ç ") |
| | | { |
| | | //æ¡ç ç¼å· = æ¡ç åç¼ + æµæ°´å· |
| | | TM = HTMNumber + LSH2; |
| | | HDate = DateTime.Now.ToShortDateString(); |
| | | DataSet DSet = oCn.RunProcReturn("select * from Gy_FactoryDayOff Where HFactoryDayOffDate='" + HDate.ToString() + "'", "Gy_FactoryDayOff", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //çæé¦è¡æ é¢ |
| | | if (DSet == null || DSet.Tables[0].Rows.Count == 0) |
| | | { |
| | | HDate = DateTime.Now.ToShortDateString(); |
| | | HYear = ClsPub.isDate(HDate).Year.ToString().Substring(2, 2); |
| | | HPeriod = "0" + ClsPub.isDate(HDate).Month.ToString(); |
| | | HPeriod = HPeriod.Substring(HPeriod.Length - 2, 2); |
| | | HDay = "0" + ClsPub.isDate(HDate).Day.ToString(); |
| | | HDay = HDay.Substring(HDay.Length - 2, 2); |
| | | HTMNumber = HOrgNumber + HMaterNumber + HYear + HPeriod + HDay; |
| | | Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HTMNumber + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· |
| | | LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]); |
| | | TM = HTMNumber + LSH2; |
| | | } |
| | | else |
| | | { |
| | | HDate = DBUtility.ClsPub.isStrNull(DSet.Tables[0].Rows[0]["HNoFactoryDayOffDate"]); |
| | | HYear = ClsPub.isDate(HDate).Year.ToString().Substring(2, 2); |
| | | HPeriod = "0" + ClsPub.isDate(HDate).Month.ToString(); |
| | | HPeriod = HPeriod.Substring(HPeriod.Length - 2, 2); |
| | | HDay = "0" + ClsPub.isDate(HDate).Day.ToString(); |
| | | HDay = HDay.Substring(HDay.Length - 2, 2); |
| | | HTMNumber = HOrgNumber + HMaterNumber + HYear + HPeriod + HDay; |
| | | Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HTMNumber + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· |
| | | LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]); |
| | | TM = HTMNumber + LSH2 + "+"; |
| | | } |
| | | //HYear = ClsPub.isDate(HDate).Year.ToString().Substring(2, 2); |
| | | //HPeriod = "0" + ClsPub.isDate(HDate).Month.ToString(); |
| | | //HPeriod = HPeriod.Substring(HPeriod.Length - 2, 2); |
| | | //HDay = "0" + ClsPub.isDate(HDate).Day.ToString(); |
| | | //HDay = HDay.Substring(HDay.Length - 2, 2); |
| | | //HTMNumber = HOrgNumber + HMaterNumber + HYear + HPeriod + HDay; |
| | | //Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HTMNumber + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· |
| | | //LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]); |
| | | } |
| | | //if (cmbHBarCodeType.Text == "å¯ä¸æ¡ç ") |
| | | //{ |
| | | // //æ¡ç ç¼å· = æ¡ç åç¼ + æµæ°´å· |
| | | // TM = HTMNumber + LSH2; |
| | | //} |
| | | if (TM.Trim() == "") |
| | | { |
| | | MessageBox.Show("æ¡å½¢ç ä¸è½ä¸ºç©ºï¼ä¸è½çææ¡ç ï¼"); |