| | |
| | | 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); |
| | | string HPrdDate = ""; |
| | | string HBC = ""; |
| | | |
| | | 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 = dtpHBeginDate.Value.ToShortDateString(); |
| | | |
| | | //夿å½åæ¶é´æ¯å¦å¨å·¥ä½æ¶é´æ®µå
|
| | | string _strWorkingDayAM = "07:30";//工使¶é´ä¸å08:30 |
| | | string _strWorkingDayPM = "19:30"; |
| | | string _strWorkingDayTM = "00:00"; |
| | | string _strWorkingDaySM = "23:59"; |
| | | TimeSpan dspWorkingDayAM = DateTime.Parse(_strWorkingDayAM).TimeOfDay; |
| | | TimeSpan dspWorkingDayPM = DateTime.Parse(_strWorkingDayPM).TimeOfDay; |
| | | TimeSpan dspWorkingDayTM = DateTime.Parse(_strWorkingDayTM).TimeOfDay; |
| | | TimeSpan dspWorkingDaySM = DateTime.Parse(_strWorkingDaySM).TimeOfDay; |
| | | |
| | | //string time1 = "2017-2-17 8:10:00"; |
| | | DateTime t1 = Convert.ToDateTime(HDate); |
| | | |
| | | TimeSpan dspNow = t1.TimeOfDay; |
| | | //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); |
| | | if (DSet2 == null || DSet2.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 + "'"); |
| | | HPrdDate = HDate; |
| | | } |
| | | 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 + "'"); |
| | | HPrdDate = DBUtility.ClsPub.isStrNull(DSet2.Tables[0].Rows[0]["HNoFactoryDayOffDate"]); |
| | | } |
| | | } |
| | | //2.大äº19ï¼30 å°äº24ï¼00 å¤ç |
| | | if (dspNow > dspWorkingDayPM && dspNow < dspWorkingDaySM) |
| | | { |
| | | HBC = "å¤ç"; |
| | | DataSet DSet2 = oCn.RunProcReturn("select * from Gy_FactoryDayOff Where HFactoryDayOffDate='" + HDate.ToString() + "'", "Gy_FactoryDayOff", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if (DSet2 == null || DSet2.Tables[0].Rows.Count == 0) |
| | | { |
| | | HPrdDate = HDate; |
| | | } |
| | | else |
| | | { |
| | | HPrdDate = DBUtility.ClsPub.isStrNull(DSet2.Tables[0].Rows[0]["HNoFactoryDayOffDate"]); |
| | | } |
| | | } |
| | | //3.大äº00ï¼00 å°äº7ï¼30 ç½ç å
åä¸å¤© å夿åäºä¸å¤©çæ¥ææ¯ä¸æ¯å伿¥æ |
| | | if (dspNow > dspWorkingDayTM && dspNow < dspWorkingDayAM) |
| | | { |
| | | HBC = "å¤ç"; |
| | | HDate = DBUtility.ClsPub.isStrNull(DBUtility.ClsPub.isDate(HDate).AddDays(-1)); |
| | | HDate = DBUtility.ClsPub.isDate(HDate).ToShortDateString(); |
| | | DataSet DSet2 = oCn.RunProcReturn("select * from Gy_FactoryDayOff Where HFactoryDayOffDate='" + HDate.ToString() + "'", "Gy_FactoryDayOff", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if (DSet2 == null || DSet2.Tables[0].Rows.Count == 0) |
| | | { |
| | | HPrdDate = HDate; |
| | | } |
| | | else |
| | | { |
| | | HPrdDate = DBUtility.ClsPub.isStrNull(DSet2.Tables[0].Rows[0]["HNoFactoryDayOffDate"]); |
| | | } |
| | | } |
| | | HYear = ClsPub.isDate(HPrdDate).Year.ToString().Substring(2, 2); |
| | | HPeriod = "0" + ClsPub.isDate(HPrdDate).Month.ToString(); |
| | | HPeriod = HPeriod.Substring(HPrdDate.Length - 2, 2); |
| | | HDay = "0" + ClsPub.isDate(HPrdDate).Day.ToString(); |
| | | HDay = HDay.Substring(HPrdDate.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 + "'"); |
| | | |
| | | |
| | | //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 + "'"); |
| | | // } |
| | | |
| | | //=============æ ¹æ®çé¢ä¸å·²ç»åé
çæ°æ®è¿è¡æ¡ç çæåæå°ã |
| | | //è·åæ¬æ¬¡çæç 主å
ç |