| | |
| | | DataSet Ds; |
| | | int LSH = 0; //æµæ°´å· |
| | | string LSH2 = ""; //æµæ°´å·è½¬æ¢æå符 |
| | | |
| | | |
| | | double HZXQty = 0; //è£
ç®±æ°é |
| | | double HDDQty = 0; //è®¢åæ°é |
| | | double HBQty = 0; //ç®±æ° |
| | |
| | | string sPackBarCode = ""; |
| | | string HPrdDate = ""; |
| | | string HBC = ""; |
| | | string HDate1 = ""; |
| | | DataSet Ds99; |
| | | |
| | | //ç®±å· |
| | | string HXH = ""; |
| | | //ç®±å·æµæ°´å· |
| | | int LSH3 = 0; //æµæ°´å· |
| | | string LSH4 = ""; //æµæ°´å·è½¬æ¢æå符 |
| | | //æºå° |
| | | string HJT = ""; |
| | | |
| | | |
| | | HDate = dtpHBeginDate.Value.ToShortDateString(); |
| | | HDate = DateTime.Now.ToString(); |
| | | |
| | | //夿å½åæ¶é´æ¯å¦å¨å·¥ä½æ¶é´æ®µå
|
| | | string _strWorkingDayAM = "07:30";//工使¶é´ä¸å08:30 |
| | |
| | | DateTime t1 = Convert.ToDateTime(HDate); |
| | | |
| | | TimeSpan dspNow = t1.TimeOfDay; |
| | | HDate1 = Convert.ToDateTime(HDate).ToShortDateString(); |
| | | //1.æ£å¸¸ä¸çæ¶é´ å°±æ¯ç½ç 妿䏿¯ç¤¼æå¤© å°±å¾åæåä¸å¤© |
| | | if (dspNow > dspWorkingDayAM && dspNow < dspWorkingDayPM) |
| | | { |
| | | HBC = "ç½ç"; |
| | | DataSet DSet2 = oCn.RunProcReturn("select * from Gy_FactoryDayOff Where HFactoryDayOffDate='" + HDate.ToString() + "'", "Gy_FactoryDayOff", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | DataSet DSet2 = oCn.RunProcReturn("select * from Gy_FactoryDayOff Where HFactoryDayOffDate='" + HDate1.ToString() + "'", "Gy_FactoryDayOff", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if (DSet2 == null || DSet2.Tables[0].Rows.Count == 0) |
| | | { |
| | | HPrdDate = HDate; |
| | |
| | | if (dspNow > dspWorkingDayPM && dspNow < dspWorkingDaySM) |
| | | { |
| | | HBC = "å¤ç"; |
| | | DataSet DSet2 = oCn.RunProcReturn("select * from Gy_FactoryDayOff Where HFactoryDayOffDate='" + HDate.ToString() + "'", "Gy_FactoryDayOff", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | DataSet DSet2 = oCn.RunProcReturn("select * from Gy_FactoryDayOff Where HFactoryDayOffDate='" + HDate1.ToString() + "'", "Gy_FactoryDayOff", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if (DSet2 == null || DSet2.Tables[0].Rows.Count == 0) |
| | | { |
| | | HPrdDate = HDate; |
| | |
| | | } |
| | | HYear = ClsPub.isDate(HPrdDate).Year.ToString().Substring(2, 2); |
| | | HPeriod = "0" + ClsPub.isDate(HPrdDate).Month.ToString(); |
| | | HPeriod = HPeriod.Substring(HPrdDate.Length - 2, 2); |
| | | HPeriod = HPeriod.Substring(HPeriod.Length - 2, 2); |
| | | HDay = "0" + ClsPub.isDate(HPrdDate).Day.ToString(); |
| | | HDay = HDay.Substring(HPrdDate.Length - 2, 2); |
| | | 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() + "+"; |
| | | DataSet DSet3 = oCn.RunProcReturn("select * from Gy_FactoryDayOff Where HFactoryDayOffDate='" + HDate1.ToString() + "'", "Gy_FactoryDayOff", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if (DSet3 == null || DSet3.Tables[0].Rows.Count == 0) |
| | | { |
| | | sPackBarCode = sPackStr + TTM_LSH.ToString() ; |
| | | } |
| | | else |
| | | { |
| | | sPackBarCode = sPackStr + TTM_LSH.ToString() + "+"; |
| | | } |
| | | oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sPackStr + "'"); |
| | | |
| | | |
| | |
| | | HBatchNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("æ¹æ¬¡")].Value); |
| | | |
| | | HOrgNumber = ClsPub.HOrgNumber; |
| | | |
| | | |
| | | //ç®±å·çæè§å æ¥æ + æºå° + çæ¬¡ + ç©æ åªè¦è·åæå¤§çæµæ°´å· |
| | | HJT = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("设å¤")].Value); |
| | | HXH = HYear + HPeriod + HDay + HBC + HJT + HMaterNumber; |
| | | Ds99 = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HXH + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· |
| | | LSH3 = ClsPub.isInt(Ds99.Tables[0].Rows[0][0]); |
| | | LSH4 = LSH3.ToString(); |
| | | |
| | | |
| | | |
| | | //HBQty = HBQty + ClsPub.isInt(txtHBQty.Text); |
| | |
| | | ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " + |
| | | ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate " + |
| | | ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HSourceID,HInterID " + |
| | | ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HPrdDate,HBC,HInnerBillNo " + |
| | | ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HPrdDate,HBC,HXH,HInnerBillNo " + |
| | | ") values (" |
| | | + "'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID1.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString() + ", " + HMZQty.ToString() |
| | | + ",'" + HBatchNo2 + "'," + HSupID.ToString() + "," + HGroupID.ToString() + ",'" + ClsPub.CurUserName + "',getdate()," + HPrintQty.ToString() + "," + HQty2.ToString() |
| | |
| | | + ", " + HBarcodeQtys.ToString() + "," + HBarcodeNo.ToString() + "," + HDeptID.ToString() + "," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HRemark + "'" |
| | | + ", " + HCusID.ToString() + ",'" + HCusType + "','" + HEndDate.ToShortDateString() + "','" + HWorkLineName + "','" + HDate + "'" |
| | | + ", " + ClsPub.HOrgID.ToString() + "," + ClsPub.HOrgID.ToString() + ",'" + HSeOrderBillNo + "'," + HSourceID.ToString() + "," + HInterID.ToString() |
| | | + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HPrdDate + "','" + HBC + "','" + HInnerBillNo + "')"); |
| | | + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HPrdDate + "','" + HBC + "','" + LSH4 + "','" + HInnerBillNo + "')"); |
| | | |
| | | oCn.RunProc("exec h_p_WMS_SetMaxNo '" + HTMNumber + "'"); |
| | | oCn.RunProc("exec h_p_WMS_SetMaxNo '" + HXH + "'"); |
| | | DisplayTM(); |
| | | } |
| | | } |
| | | //2.循ç¯ç»æåï¼æ ¹æ® æ¬æ¬¡çæç 主å
ç ï¼ä»åå°æ°æ®åºè·å æ¡ç å表ï¼çæ ç»æå å ææ¡ç ï¼ ç´æ¥è°ç¨åå¨è¿ç¨ |
| | | //æ ¹æ®å¤ç®±ç åå
¥ ç»æå主表ï¼ç»æåå表ï¼SUMï¼å¤ç®±ç æ¡£æ¡ï¼SUMæ¡£æ¡ |
| | | 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_AddNew_test '" + sPackBarCode + "'," + HInterID_TTM.ToString() + ",'" + DBUtility.ClsPub.CurUserName + "'," + HInterID.ToString()); //æ ¹æ®ç®±æ¡ç ï¼åå
¥ 主表ï¼å表 ï¼ç®±æ¡ç æ¡£æ¡ |
| | | oCn.RunProc("exec h_p_WMS_PackUnionBill_SumSubBill " + HInterID_TTM.ToString() + ",'" + sPackBarCode + "','3783','" + DBUtility.ClsPub.CurUserName + "'," + HInterID.ToString()); //æ ¹æ®ç®±æ¡ç ï¼åå
¥ SUM表ï¼SUMæ¡ç æ¡£æ¡ |
| | | |
| | | |
| | | |
| | | |
| | | sPackBarCode = ""; |
| | | DataSet DSet = oCn.RunProcReturn("select * from h_v_IF_BarCodeBillList_CS Where HInterID=" + HInterID.ToString() + " and æ¡ç ç±»å = 'æçæ¡ç '", "h_v_IF_BarCodeBillList_CS", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | DataSet DSet = oCn.RunProcReturn("select * from h_v_IF_BarCodeBillList_CS_Test Where HInterID=" + HInterID.ToString() + " and æ¡ç ç±»å = 'æçæ¡ç '", "h_v_IF_BarCodeBillList_CS_Test", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //çæé¦è¡æ é¢ |
| | | if (DSet == null) |
| | | { |