| | |
| | | public Int64 HInterID_TTM = 0; |
| | | public string HBillNo_TTM = ""; |
| | | ClsCN SubCn = new ClsCN(); |
| | | Pub_Class.ClsGridViewSum oSumGrid = new Pub_Class.ClsGridViewSum(); |
| | | // |
| | | private void initGrid() |
| | | { |
| | |
| | | //æå½ååæ®ID åå°ä¸ä¸ªæé®éé¢ å·æ°æ¶æ¯æ¬¡åä¸é |
| | | if (DSet.Tables[0].Rows.Count > 0) |
| | | { |
| | | txtHMaterID.Tag = DBUtility.ClsPub.isInt(grdMain.Rows[0].Cells["HInterID"].Value); |
| | | txtHMaterID.Tag = DBUtility.ClsPub.isLong(grdMain.Rows[0].Cells["HInterID"].Value); |
| | | txtHMiniQty.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["æ åè£
ç®±"].Value); |
| | | //txtHMaterID.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["ç©æç¼ç "].Value); |
| | | txtHMaterModel.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["è§æ ¼åå·"].Value); |
| | | txtHMaterName.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["ç©æåç§°"].Value); |
| | | } |
| | | else |
| | | { |
| | |
| | | // } |
| | | //} |
| | | //å»ç» |
| | | //int FrCol = DBUtility.ClsPub.isInt(frmCondition.txtFrozenCol.Text); |
| | | //int FrCol = DBUtility.ClsPub.isLong(frmCondition.txtFrozenCol.Text); |
| | | //string s = frmCondition.cmbHComplete.Text; |
| | | //DBUtility.Xt_BaseBillFun.DisplayGrid(grdMain, this.Name, s,FrCol); |
| | | //ç»çº¿ |
| | |
| | | { |
| | | // |
| | | //frmCondition = new frmBillQueryCondition_New(); |
| | | oSumGrid.ogrdMain = grdMain; |
| | | this.Text = ModCaption; |
| | | //lblCaption.Text = ModCaption; |
| | | initGrid(); |
| | |
| | | string HUserName = ""; |
| | | HUserName = ClsPub.isStrNull(DBUtility.ClsPub.CurUserName); |
| | | Int64 HUserID = 0; |
| | | HUserID = ClsPub.isInt(DBUtility.ClsPub.CurUserID); |
| | | HUserID = ClsPub.isLong(DBUtility.ClsPub.CurUserID); |
| | | |
| | | DataSet DSet; |
| | | |
| | |
| | | |
| | | private void cmdHSaveBill_Click(object sender, EventArgs e) |
| | | { |
| | | |
| | | Display(); |
| | | } |
| | | |
| | |
| | | string HTMNumber = ""; |
| | | string HOrgNumber = ""; |
| | | DataSet Ds; |
| | | int LSH = 0; //æµæ°´å· |
| | | Int64 LSH = 0; //æµæ°´å· |
| | | string LSH2 = ""; //æµæ°´å·è½¬æ¢æå符 |
| | | |
| | | |
| | | double HZXQty = 0; //è£
ç®±æ°é |
| | | double HDDQty = 0; //è®¢åæ°é |
| | | double HBQty = 0; //ç®±æ° |
| | |
| | | string WeiShu = ""; //å°¾æ° |
| | | int LSHlen = 6; //æµæ°´å·é¿åº¦ |
| | | string TM = ""; //æ¡ç |
| | | string sPackBarCode = ""; |
| | | string HPrdDate = ""; |
| | | string HBC = ""; |
| | | string HDate1 = ""; |
| | | DataSet Ds99; |
| | | |
| | | HDate = dtpHBeginDate.Value.ToShortDateString(); |
| | | HYear = ClsPub.isDate(HDate).Year.ToString().Substring(2, 2); |
| | | HPeriod = "0" + ClsPub.isDate(HDate).Month.ToString(); |
| | | //ç®±å· |
| | | string HXH = ""; |
| | | //ç®±å·æµæ°´å· |
| | | Int64 LSH3 = 0; //æµæ°´å· |
| | | string LSH4 = ""; //æµæ°´å·è½¬æ¢æå符 |
| | | //æºå° |
| | | string HJT = ""; |
| | | |
| | | HDate = DateTime.Now.ToString(); |
| | | |
| | | //夿å½åæ¶é´æ¯å¦å¨å·¥ä½æ¶é´æ®µå
|
| | | 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; |
| | | HDate1 = Convert.ToDateTime(HDate).ToShortDateString(); |
| | | //1.æ£å¸¸ä¸çæ¶é´ å°±æ¯ç½ç 妿䏿¯ç¤¼æå¤© å°±å¾åæåä¸å¤© |
| | | if (dspNow > dspWorkingDayAM && dspNow < dspWorkingDayPM) |
| | | { |
| | | HBC = "ç½ç"; |
| | | |
| | | 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; |
| | | } |
| | | else |
| | | { |
| | | 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='" + HDate1.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(HPeriod.Length - 2, 2); |
| | | HDay = "0" + ClsPub.isDate(HDate).Day.ToString(); |
| | | HDay = "0" + ClsPub.isDate(HPrdDate).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; //å¤ç®±ç åç¼ |
| | | |
| | | |
| | | //è·åå¤çè¿çæ¥æè·ä»å¤©å·®å 天 ç¶åå å 个+å· |
| | | TimeSpan HCY = Convert.ToDateTime(HPrdDate) - Convert.ToDateTime(DateTime.Now.ToString()); |
| | | int a = 1; |
| | | while (a <= HCY.Days) //å½a å°äº å·®å¼å¤©æ° 循ç¯å ä¸ + å· |
| | | { |
| | | HPrdDate = HPrdDate + "+"; |
| | | a = a + 1; |
| | | } |
| | | 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.isLong(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 + "'"); |
| | | |
| | | |
| | | //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.isLong(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.isLong(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.isLong(DsTM.Tables[0].Rows[0][0]) + 1; |
| | | //string sPackBarCode = sPackStr + TTM_LSH.ToString(); |
| | | //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sPackStr + "'"); |
| | | |
| | | |
| | | //MessageBox.Show("11"); |
| | |
| | | HOrgNumber = ClsPub.HOrgNumber; |
| | | |
| | | |
| | | //HBQty = HBQty + ClsPub.isInt(txtHBQty.Text); |
| | | //ç®±å·çæè§å æ¥æ + æºå° + çæ¬¡ + ç©æ åªè¦è·åæå¤§çæµæ°´å· |
| | | string sBoxYear; |
| | | string sBoxPeriod; |
| | | string sBoxDay; |
| | | DateTime HBoxDate = DBUtility.ClsPub.isDate(DBUtility.ClsPub.GetServerDate(0)); |
| | | sBoxYear = HBoxDate.Year.ToString().Substring(2, 2); |
| | | sBoxPeriod = "0" + HBoxDate.Month.ToString(); |
| | | sBoxPeriod = HPeriod.Substring(HPeriod.Length - 2, 2); |
| | | sBoxDay = "0" + HBoxDate.Day.ToString(); |
| | | sBoxDay = HDay.Substring(HDay.Length - 2, 2); |
| | | HJT = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("设å¤")].Value); |
| | | HXH = sBoxYear + sBoxPeriod + sBoxDay + HBC + HJT + HMaterNumber; |
| | | Ds99 = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HXH + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· |
| | | LSH3 = ClsPub.isLong(Ds99.Tables[0].Rows[0][0]) + 1; |
| | | LSH4 = LSH3.ToString(); |
| | | |
| | | |
| | | |
| | | //HBQty = HBQty + ClsPub.isLong(txtHBQty.Text); |
| | | HZXQty = DBUtility.ClsPub.isDoule(grdMain.Rows[j].Cells[Fun_GetCol("æ¬æ¬¡æ°é")].Value); |
| | | HDDQty = DBUtility.ClsPub.isDoule(grdMain.Rows[j].Cells[Fun_GetCol("çäº§è®¢åæ°é")].Value); |
| | | HICMOBillNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("ç产订åå·")].Value); |
| | | |
| | | 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]); |
| | | LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); |
| | | n = 0; |
| | | LSH2 = LSH.ToString(); |
| | | while (LSH2.Length < LSHlen) //å¦ææµæ°´å·å°äº6使°åé¢è¡¥0 |
| | |
| | | HWorkLineName = ""; |
| | | HSeOrderBillNo = ""; |
| | | HInnerBillNo = sPackBarCode; |
| | | HSourceID = ClsPub.isInt(txtHSourceID.Tag); |
| | | HSourceID = ClsPub.isLong(txtHSourceID.Tag); |
| | | oCn.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HMaterialMQty" + |
| | | ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " + |
| | | ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " + |
| | | ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate " + |
| | | ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HSourceID,HInterID " + |
| | | ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,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 + "','" + 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 + "'," + 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) |
| | | { |
| | |
| | | //Sub_SaveBarCode(); |
| | | //// |
| | | |
| | | |
| | | |
| | | //bool flag = this.txtHZXQty.Text.Trim() != ""; |
| | | //double num; |
| | | //double HICMOQty = 0; |
| | | //if (flag) |
| | | //{ |
| | | // num = Pub_Class.ClsPub.isDoule(this.txtHZXQty.Text); |
| | | //} |
| | | //else |
| | | //{ |
| | | // num = Pub_Class.ClsPub.isDoule(this.txtHMiniQty.Text); |
| | | //} |
| | | //bool flag2 = num <= 0.0; |
| | | //if (flag2) |
| | | //{ |
| | | // MessageBox.Show("请è¾å
¥æ´ç®±æ°éï¼"); |
| | | //} |
| | | //else |
| | | //{ |
| | | // 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) |
| | | // { |
| | | // break; |
| | | // } |
| | | // bool flag4 = num > Pub_Class.ClsPub.isDoule(this.grdMain.Rows[i].Cells["çäº§è®¢åæ°é"].Value); |
| | | // if (!flag4) |
| | | // { |
| | | // this.grdMain.Rows[i].Cells["æ¬æ¬¡æ°é"].Value = num; |
| | | // break; |
| | | // } |
| | | // num -= Pub_Class.ClsPub.isDoule(this.grdMain.Rows[i].Cells["çäº§è®¢åæ°é"].Value); |
| | | // this.grdMain.Rows[i].Cells["æ¬æ¬¡æ°é"].Value = Pub_Class.ClsPub.isDoule(this.grdMain.Rows[i].Cells["çäº§è®¢åæ°é"].Value); |
| | | // } |
| | | // this.Sub_SaveBarCode(); |
| | | |
| | | bool flag = this.txtHZXQty.Text.Trim() != ""; |
| | | double HICMOQty = 0.0; |
| | | bool flag5 = flag; |
| | | double num; |
| | | if (flag) |
| | | if (flag5) |
| | | { |
| | | num = Pub_Class.ClsPub.isDoule(this.txtHZXQty.Text); |
| | | num = ClsPub.isDoule(this.txtHZXQty.Text); |
| | | } |
| | | else |
| | | { |
| | | num = Pub_Class.ClsPub.isDoule(this.txtHMiniQty.Text); |
| | | num = ClsPub.isDoule(this.txtHMiniQty.Text); |
| | | } |
| | | bool flag2 = num <= 0.0; |
| | | if (flag2) |
| | | bool flag6 = flag2; |
| | | if (flag6) |
| | | { |
| | | MessageBox.Show("请è¾å
¥æ´ç®±æ°éï¼"); |
| | | } |
| | |
| | | { |
| | | for (int i = 0; i < this.grdMain.Rows.Count; i++) |
| | | { |
| | | for (int i2 = 0; i2 < this.grdMain.Rows.Count; i2++) |
| | | { |
| | | HICMOQty += ClsPub.isDoule(this.grdMain.Rows[i2].Cells["çäº§è®¢åæ°é"].Value); |
| | | } |
| | | bool flag7 = HICMOQty < num; |
| | | if (flag7) |
| | | { |
| | | MessageBox.Show("请ç¹å»è¶
é¢ç产æé®çææ¡ç ï¼"); |
| | | break; |
| | | } |
| | | bool flag3 = num > 0.0; |
| | | if (!flag3) |
| | | bool flag8 = !flag3; |
| | | if (flag8) |
| | | { |
| | | break; |
| | | } |
| | | bool flag4 = num > Pub_Class.ClsPub.isDoule(this.grdMain.Rows[i].Cells["çäº§è®¢åæ°é"].Value); |
| | | if (!flag4) |
| | | bool flag4 = num > ClsPub.isDoule(this.grdMain.Rows[i].Cells["çäº§è®¢åæ°é"].Value); |
| | | bool flag9 = !flag4; |
| | | if (flag9) |
| | | { |
| | | this.grdMain.Rows[i].Cells["æ¬æ¬¡æ°é"].Value = num; |
| | | break; |
| | | } |
| | | num -= Pub_Class.ClsPub.isDoule(this.grdMain.Rows[i].Cells["çäº§è®¢åæ°é"].Value); |
| | | this.grdMain.Rows[i].Cells["æ¬æ¬¡æ°é"].Value = Pub_Class.ClsPub.isDoule(this.grdMain.Rows[i].Cells["çäº§è®¢åæ°é"].Value); |
| | | num -= ClsPub.isDoule(this.grdMain.Rows[i].Cells["çäº§è®¢åæ°é"].Value); |
| | | this.grdMain.Rows[i].Cells["æ¬æ¬¡æ°é"].Value = ClsPub.isDoule(this.grdMain.Rows[i].Cells["çäº§è®¢åæ°é"].Value); |
| | | } |
| | | this.Sub_SaveBarCode(); |
| | | } |
| | |
| | | string HTMNumber = ""; |
| | | string HOrgNumber = ""; |
| | | DataSet Ds; |
| | | int LSH = 0; //æµæ°´å· |
| | | Int64 LSH = 0; //æµæ°´å· |
| | | string LSH2 = ""; //æµæ°´å·è½¬æ¢æå符 |
| | | double HZXQty = 0; //è£
ç®±æ°é |
| | | double HDDQty = 0; //è®¢åæ°é |
| | |
| | | HOrgNumber = ClsPub.HOrgNumber; |
| | | |
| | | |
| | | //HBQty = HBQty + ClsPub.isInt(txtHBQty.Text); |
| | | //HBQty = HBQty + ClsPub.isLong(txtHBQty.Text); |
| | | HZXQty = ClsPub.isDoule(txtHZXQty.Text); |
| | | HDDQty = DBUtility.ClsPub.isDoule(grdMain.Rows[j].Cells[Fun_GetCol("è®¢åæ°é")].Value); |
| | | |
| | |
| | | { |
| | | 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]); |
| | | LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); |
| | | } |
| | | else if (cmbHBarCodeType.Text == "æ¹æ¬¡æ¡ç ") |
| | | { |
| | |
| | | string HTMNumber = ""; |
| | | string HOrgNumber = ""; |
| | | DataSet Ds; |
| | | int LSH = 0; //æµæ°´å· |
| | | Int64 LSH = 0; //æµæ°´å· |
| | | string LSH2 = ""; //æµæ°´å·è½¬æ¢æå符 |
| | | double HZXQty = 0; //è£
ç®±æ°é |
| | | double HDDQty = 0; //è®¢åæ°é |
| | |
| | | HOrgNumber = ClsPub.HOrgNumber; |
| | | |
| | | |
| | | //HBQty = HBQty + ClsPub.isInt(txtHBQty.Text); |
| | | //HBQty = HBQty + ClsPub.isLong(txtHBQty.Text); |
| | | HZXQty = ClsPub.isDoule(txtHZXQty.Text); |
| | | HDDQty = DBUtility.ClsPub.isDoule(grdMain.Rows[j].Cells[Fun_GetCol("è®¢åæ°é")].Value); |
| | | HICMOBillNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("ç产订åå·")].Value); |
| | |
| | | { |
| | | 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]); |
| | | LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); |
| | | } |
| | | else if (cmbHBarCodeType.Text == "æ¹æ¬¡æ¡ç ") |
| | | { |
| | |
| | | } |
| | | 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.isLong(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.isLong(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.isLong(Ds.Tables[0].Rows[0][0]); |
| | | } |
| | | //if (cmbHBarCodeType.Text == "å¯ä¸æ¡ç ") |
| | | //{ |
| | | // //æ¡ç ç¼å· = æ¡ç åç¼ + æµæ°´å· |
| | | // TM = HTMNumber + LSH2; |
| | | //} |
| | | if (TM.Trim() == "") |
| | | { |
| | | MessageBox.Show("æ¡å½¢ç ä¸è½ä¸ºç©ºï¼ä¸è½çææ¡ç ï¼"); |
| | |
| | | |
| | | private void DisplayTM() |
| | | { |
| | | //HInterID = DBUtility.ClsPub.isInt(txtHMaterID.Tag); |
| | | DataSet DSet = oCn.RunProcReturn("select * from h_v_IF_BarCodeBillList Where HinterID=" + HInterID.ToString() + " and æ¡ç ç±»å = 'æçæ¡ç ' order by HItemID", "h_v_IF_BarCodeBillList", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //HInterID = DBUtility.ClsPub.isLong(txtHMaterID.Tag); |
| | | DataSet DSet = oCn.RunProcReturn("select * from h_v_IF_BarCodeBillList_test Where HinterID=" + HInterID.ToString() + " and æ¡ç ç±»å = 'æçæ¡ç ' order by HItemID", "h_v_IF_BarCodeBillList_test", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //çæé¦è¡æ é¢ |
| | | if (DSet == null) |
| | | { |
| | |
| | | // |
| | | grdSub.DataSource = DSet.Tables[0].DefaultView; |
| | | //å»ç» |
| | | //int FrCol = DBUtility.ClsPub.isInt(frmCondition.txtFrozenCol.Text); |
| | | //int FrCol = DBUtility.ClsPub.isLong(frmCondition.txtFrozenCol.Text); |
| | | //string s = frmCondition.cmbHComplete.Text; |
| | | //DBUtility.Xt_BaseBillFun.DisplayGrid(grdSub, this.Name, s, FrCol); |
| | | //ç»çº¿ |
| | |
| | | { |
| | | //è·åç½æ ¼ç¬¬ä¸è¡HInterIDçå¼ |
| | | Int64 HInterID = 0; |
| | | HInterID = DBUtility.ClsPub.isInt(txtHMaterID.Tag); |
| | | HInterID = DBUtility.ClsPub.isLong(txtHMaterID.Tag); |
| | | DataSet DSBefore; |
| | | DSBefore = SubCn.RunProcReturn("exec h_p_PreviousMater "+ HInterID, "h_p_PreviousMater", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | grdMain.DataSource = DSBefore.Tables[0].DefaultView; |
| | | //if (DSBefore.Tables[0].Rows.Count > 0) |
| | | //{ |
| | | // txtHMaterID.Tag = DBUtility.ClsPub.isInt(grdMain.Rows[0].Cells["HInterID"].Value); |
| | | // txtHMaterID.Tag = DBUtility.ClsPub.isLong(grdMain.Rows[0].Cells["HInterID"].Value); |
| | | //} |
| | | //else |
| | | //{ |
| | |
| | | else |
| | | { |
| | | grdMain.DataSource = DSBefore.Tables[0].DefaultView; |
| | | txtHMaterID.Tag = DBUtility.ClsPub.isInt(grdMain.Rows[0].Cells["HInterID"].Value); |
| | | txtHMaterID.Tag = DBUtility.ClsPub.isLong(grdMain.Rows[0].Cells["HInterID"].Value); |
| | | txtHMiniQty.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["æ åè£
ç®±"].Value); |
| | | txtHMaterModel.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["è§æ ¼åå·"].Value); |
| | | txtHMaterName.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["ç©æåç§°"].Value); |
| | | } |
| | | |
| | | |
| | |
| | | { |
| | | //æ ¹æ® |
| | | Int64 HInterID = 0; |
| | | //HInterID = DBUtility.ClsPub.isInt(grdMain.Rows[0].Cells[Fun_GetCol("HInterID")].Value); |
| | | HInterID = DBUtility.ClsPub.isInt(txtHMaterID.Tag); |
| | | //HInterID = DBUtility.ClsPub.isLong(grdMain.Rows[0].Cells[Fun_GetCol("HInterID")].Value); |
| | | HInterID = DBUtility.ClsPub.isLong(txtHMaterID.Tag); |
| | | DataSet DSBefore; |
| | | DSBefore = SubCn.RunProcReturn("exec h_p_NextMater " + HInterID, "h_p_NextMater", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if (DSBefore == null || DSBefore.Tables[0].Rows.Count == 0) |
| | |
| | | else |
| | | { |
| | | grdMain.DataSource = DSBefore.Tables[0].DefaultView; |
| | | txtHMaterID.Tag = DBUtility.ClsPub.isInt(grdMain.Rows[0].Cells["HInterID"].Value); |
| | | txtHMaterID.Tag = DBUtility.ClsPub.isLong(grdMain.Rows[0].Cells["HInterID"].Value); |
| | | txtHMiniQty.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["æ åè£
ç®±"].Value); |
| | | txtHMaterModel.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["è§æ ¼åå·"].Value); |
| | | txtHMaterName.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["ç©æåç§°"].Value); |
| | | } |
| | | //txtHMaterID.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["HInterID"].Value); |
| | | } |
| | |
| | | Thread.Sleep(1000); |
| | | } |
| | | } |
| | | |
| | | private void label14_Click(object sender, EventArgs e) |
| | | { |
| | | |
| | | } |
| | | } |
| | | } |