| | |
| | | public string sDlgWhere = ""; //å¤çªä½éå
¥ |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | | public Int64 HInterID = 0; |
| | | public const string ModName1 = "3783"; |
| | | public Int64 HInterID_TTM = 0; |
| | | public string HBillNo_TTM = ""; |
| | | ClsCN SubCn = new ClsCN(); |
| | | Pub_Class.ClsGridViewSum oSumGrid = new Pub_Class.ClsGridViewSum(); |
| | | // |
| | | private void initGrid() |
| | | { |
| | |
| | | |
| | | private void Display() |
| | | { |
| | | ClsCN SubCn = new ClsCN(); |
| | | DataSet DSet; |
| | | string sSql = ""; |
| | | string sFastSQL = ""; |
| | |
| | | //} |
| | | string HICMOBillNo = ""; |
| | | HICMOBillNo = txtHICMOBillNo.Text.Trim().ToString(); |
| | | //éå®è®¢åå· |
| | | string HSeOrderBillNo = ""; |
| | | HICMOBillNo = txtHSeOrderBillNo.Text.Trim().ToString(); |
| | | //ç©æ |
| | | //if (txtHMaterID.Text.Trim() != "") |
| | | //{ |
| | | // sFastSQL = sFastSQL + " and HMaterName like '%" + txtHMaterID.Text + "%'"; |
| | | //} |
| | | string HMaterName = ""; |
| | | HMaterName = txtHMaterID.Text.Trim().ToString(); |
| | | HMaterName = txtHMaterID.Text.Trim().ToString(); //ç©æä»£ç |
| | | //æºå° |
| | | //if (txtHSourceID.Text.Trim() != "") |
| | | //{ |
| | |
| | | //{ |
| | | // sFastSQL = sFastSQL + " and æ¥æ<='" + dtpHEndDate.Value.ToShortDateString() + "'"; |
| | | //} |
| | | string HEndDate = ""; |
| | | HEndDate = dtpHEndDate.Value.ToShortDateString(); |
| | | //string HEndDate = ""; |
| | | //HEndDate = dtpHEndDate.Value.ToShortDateString(); |
| | | //if (sFastSQL.Trim() == "") |
| | | //{ |
| | | // MessageBox.Show("没æè¾å
¥æ¡ä»¶!"); |
| | |
| | | //è¿æ»¤æ¡ä»¶ |
| | | |
| | | // |
| | | DSet = SubCn.RunProcReturn("exec h_p_KSTMSC '" + HICMOBillNo + "' , '" + HMaterName + "' , '" + HSourceName + "' ,'" + HEmpName + "' ,'" + HBeginDate + "', '" + HEndDate + "'", "h_p_KSTMSC", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | DSet = SubCn.RunProcReturn("exec h_p_KSTMSC '" + HSeOrderBillNo + "' ,'" + HICMOBillNo + "' , '" + HMaterName + "' , '" + HSourceName + "' ,'" + HEmpName + "' ,'" + HBeginDate + "'", "h_p_KSTMSC", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //çæé¦è¡æ é¢ |
| | | if (DSet == null) |
| | | //if (DSet == null|| DSet.Tables[0].Rows.Count == 0) |
| | | { |
| | | MessageBox.Show("没æè¿åä»»ä½ç»æ,请å¨è¿æ»¤æ¡ä¸ç¹å»ãæ¢å¤ãæé®,å°è¯å次æ¥è¯¢ï¼" + DBUtility.ClsPub.sExeReturnInfo); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | grdMain.DataSource = DSet.Tables[0].DefaultView; |
| | | //æå½ååæ®ID åå°ä¸ä¸ªæé®éé¢ å·æ°æ¶æ¯æ¬¡åä¸é |
| | | if (DSet.Tables[0].Rows.Count > 0) |
| | | { |
| | | 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 |
| | | { |
| | | |
| | | } |
| | | } |
| | | // |
| | | grdMain.DataSource = DSet.Tables[0].DefaultView; |
| | | |
| | | |
| | | |
| | | //æ åè£
ç®± |
| | | //for (int i = 0; i < grdMain.SelectedRows.Count; i++) |
| | | //{ |
| | |
| | | // } |
| | | //} |
| | | //å»ç» |
| | | //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); |
| | | //ç»çº¿ |
| | | GraphLine(); |
| | | |
| | | |
| | | |
| | | |
| | | // |
| | | } |
| | | |
| | | // |
| | | private void timer1_Tick(object sender, EventArgs e) |
| | | { |
| | | timer1.Enabled=false; |
| | | timer1.Enabled = false; |
| | | initGrid(); |
| | | Display(); |
| | | } |
| | |
| | | { |
| | | // |
| | | //frmCondition = new frmBillQueryCondition_New(); |
| | | oSumGrid.ogrdMain = grdMain; |
| | | this.Text = ModCaption; |
| | | //lblCaption.Text = ModCaption; |
| | | initGrid(); |
| | | cmbHBarCodeType.SelectedIndex = 0; |
| | | dtpHBeginDate.Value = DateTime.Today; |
| | | string HUserName = ""; |
| | | HUserName = ClsPub.isStrNull(DBUtility.ClsPub.CurUserName); |
| | | Int64 HUserID = 0; |
| | | HUserID = ClsPub.isLong(DBUtility.ClsPub.CurUserID); |
| | | |
| | | DataSet DSet; |
| | | |
| | | DSet = oCn.RunProcReturn("Select HEmpID from gy_czygl Where czymc='" + HUserName + "'", "gy_czygl", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | if (DSet == null) |
| | | //if (DSet == null|| DSet.Tables[0].Rows.Count == 0) |
| | | { |
| | | MessageBox.Show("没æè¿åä»»ä½ç»æ,请å¨è¿æ»¤æ¡ä¸ç¹å»ãæ¢å¤ãæé®,å°è¯å次æ¥è¯¢ï¼" + DBUtility.ClsPub.sExeReturnInfo); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | //grdMain.DataSource = DSet.Tables[0].DefaultView; |
| | | //æå½ååæ®ID åå°ä¸ä¸ªæé®éé¢ å·æ°æ¶æ¯æ¬¡åä¸é |
| | | if (DSet.Tables[0].Rows.Count > 0) |
| | | { |
| | | |
| | | |
| | | txtHEmpID.Tag = DBUtility.ClsPub.isStrNull(DSet.Tables[0].Rows[0]["HEmpID"]); |
| | | } |
| | | else |
| | | { |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | private void grdMain_DblClick(object sender, EventArgs e) |
| | |
| | | //å é¤ |
| | | private void Sub_DeleteBill() |
| | | { |
| | | // //ç¼è¾æé |
| | | // //ç¼è¾æé |
| | | if (!DBUtility.ClsPub.Security_Log(ModRightNameEdit, 1, true, DBUtility.ClsPub.CurUserName)) |
| | | { |
| | | return; |
| | |
| | | //} |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | private void bclk_Click(object sender, EventArgs e) |
| | | { |
| | |
| | | private void Sub_CheckBill() |
| | | { |
| | | //å®¡æ ¸æé |
| | | if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true,DBUtility.ClsPub.CurUserName)) |
| | | if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, DBUtility.ClsPub.CurUserName)) |
| | | { |
| | | return; |
| | | } |
| | |
| | | lngBillKey = DBUtility.ClsPub.isLong(grdMain.Rows[grdMain.CurrentRow.Index].Cells[Fun_GetCol("hmainid")].Value); |
| | | if (lngBillKey == 0) |
| | | return; |
| | | DAL.ClsGy_ICBomBill oBill = new DAL.ClsGy_ICBomBill(); |
| | | DAL.ClsGy_ICBomBill oBill = new DAL.ClsGy_ICBomBill(); |
| | | //æ¥çæ¯å¦å·²å®¡æ ¸,å
³é,ä½åº |
| | | if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | |
| | | private void Sub_AbandonCheck() |
| | | { |
| | | //å®¡æ ¸æé |
| | | if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true,DBUtility.ClsPub.CurUserName)) |
| | | if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, DBUtility.ClsPub.CurUserName)) |
| | | { |
| | | return; |
| | | } |
| | |
| | | lngBillKey = DBUtility.ClsPub.isLong(grdMain.Rows[grdMain.CurrentRow.Index].Cells[Fun_GetCol("hmainid")].Value); |
| | | if (lngBillKey == 0) |
| | | return; |
| | | DAL.ClsGy_ICBomBill oBill = new DAL.ClsGy_ICBomBill(); |
| | | DAL.ClsGy_ICBomBill oBill = new DAL.ClsGy_ICBomBill(); |
| | | //æ¥çæ¯å¦å·²å®¡æ ¸,å
³é,ä½åº |
| | | if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | |
| | | private void Sub_SetReport(string sOpenTmp) |
| | | { |
| | | //å¤æè¡æ° |
| | | for (int i = 0; i < grdMain.Rows.Count; i++) |
| | | { |
| | | grdMain.Rows[i].Cells[0].Value = ""; |
| | | } |
| | | for (int i = 0; i < grdMain.SelectedRows.Count; i++) |
| | | { |
| | | grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[0].Value = "*"; |
| | | } |
| | | //for (int i = 0; i < grdList.Rows.Count; i++) |
| | | //{ |
| | | // grdList.Rows[i].Cells[0].Value = ""; |
| | | //} |
| | | //for (int i = 0; i < grdList.SelectedRows.Count; i++) |
| | | //{ |
| | | // grdList.Rows[grdMain.SelectedRows[i].Index].Cells[0].Value = "*"; |
| | | //} |
| | | // |
| | | Report = new GridppReport(); |
| | | Report.LoadFromFile(DBUtility.ClsPub.AppPath + @"\" + sOpenTmp + ".grf"); //here . |
| | |
| | | try |
| | | { |
| | | DataTable ds = new DataTable(); |
| | | BLL.Utility.FillRecordToReport_Sel(Report, grdMain, ds, Fun_GetCol("éæ©")); |
| | | BLL.Utility.FillRecordToReport_Sel(Report, grdList, ds, Fun_GetCol("éæ©")); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | private void zf_Click(object sender, EventArgs e) |
| | | { |
| | | //Sub_AbandonCheck(); |
| | | if (!ClsPub.Security_Log(ModRightNameDelete, 1, true, DBUtility.ClsPub.CurUserName)) |
| | | { |
| | | return; |
| | | } |
| | | if (grdMain.CurrentRow == null) |
| | | return; |
| | | DAL.ClsGy_BarCodeBill_Ctl oBar = new DAL.ClsGy_BarCodeBill_Ctl(); |
| | | if (MessageBox.Show("ç¡®å®è¦ä½åºæéæ¡ç ï¼", "æç¤º", MessageBoxButtons.OKCancel) == DialogResult.Cancel) |
| | | { |
| | | return; |
| | | } |
| | | for (int i = 0; i <= grdMain.SelectedRows.Count - 1; i++) |
| | | { |
| | | if (DBUtility.ClsPub.isLong(grdMain.SelectedRows[i].Cells[Fun_GetCol("HMaterID")].Value) != 0) |
| | | { |
| | | if (!oBar.Cancelltion(DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("æ¡ç ç¼å·")].Value))) |
| | | { |
| | | MessageBox.Show("ä½åºå¤±è´¥ï¼", "æç¤º"); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | MessageBox.Show("ä½åºæåï¼", "æç¤º"); |
| | | } |
| | | |
| | | private void fzf_Click(object sender, EventArgs e) |
| | | { |
| | | //this.Sub_CheckBill(); |
| | | if (!ClsPub.Security_Log(ModRightNameDelete, 1, true, DBUtility.ClsPub.CurUserName)) |
| | | { |
| | | return; |
| | | } |
| | | if (grdMain.CurrentRow == null) |
| | | return; |
| | | DAL.ClsGy_BarCodeBill_Ctl oBar = new DAL.ClsGy_BarCodeBill_Ctl(); |
| | | if (MessageBox.Show("ç¡®å®è¦åä½åºæéæ¡ç ï¼", "æç¤º", MessageBoxButtons.OKCancel) == DialogResult.Cancel) |
| | | { |
| | | return; |
| | | } |
| | | for (int i = 0; i <= grdMain.SelectedRows.Count - 1; i++) |
| | | { |
| | | if (DBUtility.ClsPub.isLong(grdMain.SelectedRows[i].Cells[Fun_GetCol("HMaterID")].Value) != 0) |
| | | { |
| | | if (!oBar.UnCancelltion(DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("æ¡ç ç¼å·")].Value))) |
| | | { |
| | | MessageBox.Show("åä½åºå¤±è´¥ï¼", "æç¤º"); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | MessageBox.Show("åä½åºæåï¼", "æç¤º"); |
| | | } |
| | | |
| | | private void cmdHSaveBill_Click(object sender, EventArgs e) |
| | | { |
| | | |
| | | Display(); |
| | | } |
| | | |
| | | string TTM = ""; //ææ¡ç |
| | | string HTTMNumber = ""; |
| | | string HICMOBillNo = ""; //ç产订åå· |
| | | int TLSH = 0; |
| | | string TLSH2 = ""; |
| | | string HOrgNumber = ""; |
| | | |
| | | |
| | | |
| | | //=======çæ å¯ä¸ç å ææ¡ç ãç»æå |
| | | private void Sub_SaveBarCode()//åé
æ¶ è¦èè 订åå©ä½æ°éå·²ç»æ¯ è´æ°çæ
åµ |
| | | { |
| | | try |
| | | { |
| | | string HMaterNumber = ""; |
| | | string HBatchNo = ""; |
| | | string HDate = ""; |
| | | string HYear = ""; |
| | | string HPeriod = ""; |
| | | string HDay = ""; |
| | | string HTMNumber = ""; |
| | | string HOrgNumber = ""; |
| | | DataSet Ds; |
| | | Int64 LSH = 0; //æµæ°´å· |
| | | string LSH2 = ""; //æµæ°´å·è½¬æ¢æå符 |
| | | |
| | | |
| | | double HZXQty = 0; //è£
ç®±æ°é |
| | | double HDDQty = 0; //è®¢åæ°é |
| | | double HBQty = 0; //ç®±æ° |
| | | int k = 0; |
| | | int n = 0; //å䏿¹çææ¡ç ä¸çç¬¬å æ¡ |
| | | string WeiShu = ""; //å°¾æ° |
| | | int LSHlen = 6; //æµæ°´å·é¿åº¦ |
| | | string TM = ""; //æ¡ç |
| | | string sPackBarCode = ""; |
| | | string HPrdDate = ""; |
| | | string HBC = ""; |
| | | string HDate1 = ""; |
| | | DataSet Ds99; |
| | | |
| | | //ç®±å· |
| | | 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(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 + "'"); |
| | | // } |
| | | |
| | | //=============æ ¹æ®çé¢ä¸å·²ç»åé
çæ°æ®è¿è¡æ¡ç çæåæå°ã |
| | | //è·åæ¬æ¬¡çæç 主å
ç |
| | | Int64 HInterID = DBUtility.ClsPub.CreateBillID_Prod(ModName, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | HInterID = DBUtility.ClsPub.CreateBillID_Prod(ModName, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | Int64 HInterID_TTM = DBUtility.ClsPub.CreateBillID_Prod(ModName1, ref DBUtility.ClsPub.sExeReturnInfo); //ç»æåå
ç |
| | | string HBillNo_TTM = DBUtility.ClsPub.CreateBillCode_Prod(ModName1, ref DBUtility.ClsPub.sExeReturnInfo, true);//ç»æååå· |
| | | |
| | | //0 å¼å¯äºå¡ |
| | | oCn.BeginTran(); |
| | | //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.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"); |
| | | oCn.RunProc("insert into Sc_PackUnionBillMain (HYear,HPeriod,HBillType,HInterID,HDate" + |
| | | ",HBillNo,HBillStatus,HICMOBillNo,HBarCode_Pack,HMaterID,HUnitID,HWeight" + |
| | | ",HPWeight,HProdOrgID,HDeptID,HEmpID,HSNum,HPackNum,HBarCode_Cus,HBatchNo " + |
| | | ") values (" |
| | | + HYear + "," + HPeriod + ",'3783'," + HInterID_TTM + ",'" + HDate + "'" |
| | | + ", '" + sPackBarCode.ToString() + "',1,'','" + sPackBarCode.ToString() + "',0,0,0" |
| | | + ",0,1,0,0,0,0,'','')"); |
| | | //MessageBox.Show("12"); |
| | | |
| | | //1.循ç¯ç½æ ¼ï¼æ ¹æ® æ¬æ¬¡æ°é å çæ å¯ä¸ç |
| | | |
| | | for (int j = 0; j < grdMain.Rows.Count; j++) |
| | | { |
| | | if (DBUtility.ClsPub.isDoule(grdMain.Rows[j].Cells[Fun_GetCol("æ¬æ¬¡æ°é")].Value) > 0) |
| | | { |
| | | HMaterNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("ç©æä»£ç ")].Value); |
| | | HBatchNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("æ¹æ¬¡")].Value); |
| | | |
| | | HOrgNumber = ClsPub.HOrgNumber; |
| | | |
| | | |
| | | //ç®±å·çæè§å æ¥æ + æºå° + çæ¬¡ + ç©æ åªè¦è·åæå¤§çæµæ°´å· |
| | | 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.isLong(Ds.Tables[0].Rows[0][0]); |
| | | n = 0; |
| | | LSH2 = LSH.ToString(); |
| | | while (LSH2.Length < LSHlen) //å¦ææµæ°´å·å°äº6使°åé¢è¡¥0 |
| | | { |
| | | LSH2 = "0" + LSH2; |
| | | } |
| | | //æ¡ç ç¼å· = æ¡ç åç¼ + æµæ°´å· |
| | | TM = HTMNumber + LSH2; |
| | | if (TM.Trim() == "") |
| | | { |
| | | MessageBox.Show("æ¡å½¢ç ä¸è½ä¸ºç©ºï¼ä¸è½çææ¡ç ï¼"); |
| | | return; |
| | | } |
| | | string HWei = ""; //å°¾æ° |
| | | string HBarCode = ""; |
| | | string HBarCodeType = ""; |
| | | Int64 HMaterID1 = 0; |
| | | Int64 HAuxPropID = 0; |
| | | Int64 HUnitID = 0; |
| | | double HQty2 = 0; |
| | | string HBatchNo2 = ""; |
| | | Int64 HSupID = 0; |
| | | Int64 HGroupID = 0; |
| | | int HPrintQty = 0; |
| | | Int64 HSourceInterID = 0; |
| | | Int64 HSourceEntryID = 0; |
| | | string HSourceBillNo = ""; |
| | | string HSourceBillType = ""; |
| | | Int64 HBarcodeNo = 0; //æå· |
| | | Int64 HBarcodeQtys = 0; //æ»ææ° |
| | | Int64 HDeptID = 0; |
| | | Int64 HWhID = 0; |
| | | Int64 HSPID = 0; |
| | | string HRemark = ""; |
| | | string HMaterName = ""; |
| | | string HMaterModel = ""; |
| | | string HPinfan = ""; |
| | | string HMTONo = ""; |
| | | Int64 HCusID = 0; |
| | | string HCusType = ""; |
| | | DateTime HEndDate; |
| | | string HWorkLineName = ""; |
| | | string HSeOrderBillNo = ""; |
| | | string HInnerBillNo = ""; |
| | | Int64 HSourceID = 0; |
| | | //æ¯é |
| | | Double HMZQty = 0; |
| | | HMZQty = HZXQty * ClsPub.isDoule(grdMain.Rows[j].Cells[Fun_GetCol("å
é")].Value)/1000; |
| | | |
| | | HWei = WeiShu; |
| | | HBarCode = TM; |
| | | HBarCodeType = ClsPub.isStrNull(cmbHBarCodeType.Text); |
| | | HMaterID1 = ClsPub.isLong(grdMain.Rows[j].Cells[Fun_GetCol("HMaterID")].Value); |
| | | HAuxPropID = 0; |
| | | HUnitID = 0; |
| | | HQty2 = HZXQty; |
| | | HBatchNo2 = ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("æ¹æ¬¡")].Value); |
| | | HSourceInterID = ClsPub.isLong(grdMain.Rows[j].Cells[Fun_GetCol("HSourceInterID")].Value); |
| | | HSourceEntryID = ClsPub.isLong(grdMain.Rows[j].Cells[Fun_GetCol("HSourceEntryID")].Value); |
| | | HSourceBillNo = ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("ç产订åå·")].Value); |
| | | HSourceBillType = "3710"; |
| | | HBarcodeQtys = 0; |
| | | HBarcodeNo = 0; |
| | | HSupID = 0; |
| | | HDeptID = 0; |
| | | HWhID = 0; |
| | | HSPID = 0; |
| | | HRemark = ""; |
| | | HMaterName = ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("ç©æåç§°")].Value); |
| | | HMaterModel = ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("è§æ ¼åå·")].Value); |
| | | HPinfan = ""; |
| | | HMTONo = ""; |
| | | HCusID = 0; |
| | | HCusType = ""; |
| | | HEndDate = ClsPub.isDate(grdMain.Rows[j].Cells[Fun_GetCol("æ¥æ")].Value); |
| | | HWorkLineName = ""; |
| | | HSeOrderBillNo = ""; |
| | | HInnerBillNo = sPackBarCode; |
| | | 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,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() |
| | | + ", " + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HWei + "'" |
| | | + ", " + 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 + "','" + 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_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_Test Where HInterID=" + HInterID.ToString() + " and æ¡ç ç±»å = 'æçæ¡ç '", "h_v_IF_BarCodeBillList_CS_Test", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //çæé¦è¡æ é¢ |
| | | if (DSet == null) |
| | | { |
| | | MessageBox.Show("没æè¿åä»»ä½ç»æ,æ¡ç ä¸åå¨ï¼" + DBUtility.ClsPub.sExeReturnInfo); |
| | | return; |
| | | } |
| | | // |
| | | grdList.DataSource = DSet.Tables[0].DefaultView; |
| | | txtHZXQty.Text = ""; |
| | | //å»ç» |
| | | int FrCol = 0; |
| | | string s = "æ¯"; |
| | | DBUtility.Xt_BaseBillFun.DisplayGrid(grdList, this.Name + "grdList", s, FrCol); |
| | | oCn.Commit(); |
| | | //DisplayTM(); |
| | | MessageBox.Show("æ¡ç çæå®æ¯ï¼"); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //0ç»æäºå¡ |
| | | |
| | | // |
| | | //Display(); |
| | | |
| | | |
| | | } |
| | | catch (Exception e ) |
| | | { |
| | | //åæ»äºå¡ |
| | | |
| | | MessageBox.Show("çææ¡ç 失败ï¼" + e.Message); |
| | | Display(); |
| | | } |
| | | } |
| | | |
| | | private void button4_Click(object sender, EventArgs e) |
| | | { |
| | | |
| | | ////æ ¹æ®æ¬ç®±æ°é æ¥ åé
å° æ¯ä¸ªç产订åä¸ï¼åé
æ¶ è¦èè 订åå©ä½æ°éå·²ç»æ¯ è´æ°çæ
åµï¼ |
| | | ////å¦æææ åè£
ç®±æ°é å
é»è®¤åæ åè£
ç®±æ°é 没æååæè¾çæ¬ç®±æ°é |
| | | ////1.夿æ¬ç®±æ°é å¿
须大äº0 |
| | | //double HZXQty = 0;//æ´ç®±æ°é |
| | | //if (txtHZXQty.Text.Trim() != "") |
| | | //{ |
| | | // HZXQty = ClsPub.isDoule(txtHZXQty.Text); |
| | | //} |
| | | //else |
| | | //{ |
| | | // HZXQty = ClsPub.isDoule(txtHMiniQty.Text); |
| | | //} |
| | | //if (HZXQty <= 0) |
| | | //{ |
| | | // MessageBox.Show("请è¾å
¥æ´ç®±æ°éï¼"); |
| | | // return; |
| | | //} |
| | | ////2.å·æ°ç½æ ¼ |
| | | ////Display(); |
| | | ////3.ææ´ç®±æ°é åé
å° ç½æ ¼ä¸é¢çæ¯ä¸ä¸ª ç产订åä¸å»ã 循ç¯ç½æ ¼ |
| | | //for(int i =0;i<grdMain.Rows.Count;i++) |
| | | //{ |
| | | // if (HZXQty > 0) |
| | | // { |
| | | // if (HZXQty > DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["çäº§è®¢åæ°é"].Value)) |
| | | // { |
| | | // HZXQty = HZXQty - DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["çäº§è®¢åæ°é"].Value); |
| | | // grdMain.Rows[i].Cells["æ¬æ¬¡æ°é"].Value = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["çäº§è®¢åæ°é"].Value); |
| | | |
| | | // //MessageBox.Show("请ç¹å»è¶
é¢ç产æé®çææ¡ç ï¼"); |
| | | // //return; |
| | | // } |
| | | // else if (HZXQty == 0) |
| | | // { |
| | | // return; |
| | | // } |
| | | // else |
| | | // { |
| | | // grdMain.Rows[i].Cells["æ¬æ¬¡æ°é"].Value = HZXQty; |
| | | // // |
| | | |
| | | // //HZXQty = HZXQty - DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["çäº§è®¢åæ°é"].Value); |
| | | // //grdMain.Rows[i].Cells["æ¬æ¬¡æ°é"].Value = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["çäº§è®¢åæ°é"].Value); |
| | | // } |
| | | // } |
| | | // else |
| | | // { |
| | | // break; |
| | | // } |
| | | //} |
| | | //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 (flag5) |
| | | { |
| | | num = ClsPub.isDoule(this.txtHZXQty.Text); |
| | | } |
| | | else |
| | | { |
| | | num = ClsPub.isDoule(this.txtHMiniQty.Text); |
| | | } |
| | | bool flag2 = num <= 0.0; |
| | | bool flag6 = flag2; |
| | | if (flag6) |
| | | { |
| | | MessageBox.Show("请è¾å
¥æ´ç®±æ°éï¼"); |
| | | } |
| | | else |
| | | { |
| | | 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; |
| | | bool flag8 = !flag3; |
| | | if (flag8) |
| | | { |
| | | break; |
| | | } |
| | | 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 -= 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(); |
| | | } |
| | | } |
| | | |
| | | private void Sub_SaveBill() |
| | | { |
| | | HInterID = DBUtility.ClsPub.CreateBillID_Prod(ModName, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | string HMaterNumber = ""; |
| | |
| | | string HTMNumber = ""; |
| | | string HOrgNumber = ""; |
| | | DataSet Ds; |
| | | int LSH = 0; //æµæ°´å· |
| | | Int64 LSH = 0; //æµæ°´å· |
| | | string LSH2 = ""; //æµæ°´å·è½¬æ¢æå符 |
| | | double HSumQty = 0; //äº§åæ°é |
| | | double HMinQty = 0; //æå°å
è£
æ° |
| | | double HZXQty = 0; //è£
ç®±æ°é |
| | | double HDDQty = 0; //è®¢åæ°é |
| | | double HBQty = 0; //ç®±æ° |
| | | int k = 0; |
| | | int n = 0; //å䏿¹çææ¡ç ä¸çç¬¬å æ¡ |
| | | string WeiShu = ""; //å°¾æ° |
| | | int LSHlen = 6; //æµæ°´å·é¿åº¦ |
| | | string TM = ""; //æ¡ç |
| | | for (int j = 0; j < grdMain.SelectedRows.Count; j++) |
| | | for (int j = 0; j < grdMain.Rows.Count; j++) |
| | | { |
| | | HMaterNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[grdMain.SelectedRows[j].Index].Cells[Fun_GetCol("ç©æä»£ç ")].Value); |
| | | HBatchNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[grdMain.SelectedRows[j].Index].Cells[Fun_GetCol("æ¹æ¬¡")].Value); |
| | | HMaterNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("ç©æä»£ç ")].Value); |
| | | HBatchNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("æ¹æ¬¡")].Value); |
| | | HDate = DateTime.Now.ToShortDateString(); |
| | | HYear = ClsPub.isDate(HDate).Year.ToString().Substring(2, 2); |
| | | HPeriod = "0" + ClsPub.isDate(HDate).Month.ToString(); |
| | |
| | | HDay = "0" + ClsPub.isDate(HDate).Day.ToString(); |
| | | HDay = HDay.Substring(HDay.Length - 2, 2); |
| | | HOrgNumber = ClsPub.HOrgNumber; |
| | | //ç®±æ°å=æ°é/æå°å
è£
æ° |
| | | //double sMoney = 0; |
| | | //if ((DBUtility.ClsPub.isLong(grdMain.SelectedRows[j].Cells[Fun_GetCol("HMiniQty")].Value) == 0)) |
| | | //{ |
| | | // sMoney = 0; |
| | | //} |
| | | //else |
| | | //{ |
| | | // sMoney = ClsPub.isDoule(grdMain.SelectedRows[j].Cells[Fun_GetCol("HQty")].Value) / ClsPub.isDoule(grdMain.SelectedRows[j].Cells[Fun_GetCol("HMiniQty")].Value); |
| | | //} |
| | | //sMoney = Math.Ceiling(sMoney); |
| | | //grdMain.SelectedRows[j].Cells[Fun_GetCol("HBQty")].Value = sMoney; |
| | | |
| | | |
| | | HBQty = HBQty + ClsPub.isInt(txtHBQty.Text); |
| | | HMinQty = ClsPub.isDoule(txtHMiniQty.Text); |
| | | HSumQty = ClsPub.isDoule(txtHICMOQty.Text); |
| | | //HBQty = HBQty + ClsPub.isLong(txtHBQty.Text); |
| | | HZXQty = ClsPub.isDoule(txtHZXQty.Text); |
| | | HDDQty = DBUtility.ClsPub.isDoule(grdMain.Rows[j].Cells[Fun_GetCol("è®¢åæ°é")].Value); |
| | | |
| | | |
| | | if (cmbHBarCodeType.Text == "å¯ä¸æ¡ç ") |
| | | { |
| | | 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 == "æ¹æ¬¡æ¡ç ") |
| | | { |
| | | TM = HOrgNumber + HMaterNumber + HBatchNo; |
| | | } |
| | | n = 0; |
| | | for (int i = k; i < HBQty; i++) |
| | | { |
| | | if (HSumQty - HMinQty > 0) |
| | | { |
| | | WeiShu = ""; |
| | | HSumQty = HSumQty - HMinQty; |
| | | } |
| | | else |
| | | { |
| | | if (HSumQty == HMinQty) |
| | | { |
| | | WeiShu = ""; |
| | | } |
| | | else |
| | | { |
| | | WeiShu = "å°¾æ°"; |
| | | } |
| | | HMinQty = HSumQty; |
| | | } |
| | | // |
| | | LSH = LSH + 1; |
| | | |
| | | LSH2 = LSH.ToString(); |
| | | while (LSH2.Length < LSHlen) //å¦ææµæ°´å·å°äº6使°åé¢è¡¥0 |
| | | { |
| | |
| | | string HWei = ""; //å°¾æ° |
| | | string HBarCode = ""; |
| | | string HBarCodeType = ""; |
| | | Int64 HMaterID = 0; |
| | | Int64 HMaterID1 = 0; |
| | | Int64 HAuxPropID = 0; |
| | | Int64 HUnitID = 0; |
| | | double HQty2 = 0; |
| | |
| | | HWei = WeiShu; |
| | | HBarCode = TM; |
| | | HBarCodeType = ClsPub.isStrNull(cmbHBarCodeType.Text); |
| | | HMaterID = ClsPub.isLong(grdMain.SelectedRows[j].Cells[Fun_GetCol("HMaterID")].Value); |
| | | HMaterID1 = ClsPub.isLong(grdMain.Rows[j].Cells[Fun_GetCol("HMaterID")].Value); |
| | | HAuxPropID = 0; |
| | | HUnitID = 0; |
| | | HQty2 = HMinQty; |
| | | HBatchNo2 = ClsPub.isStrNull(grdMain.SelectedRows[j].Cells[Fun_GetCol("æ¹æ¬¡")].Value); |
| | | HQty2 = HZXQty; |
| | | HBatchNo2 = ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("æ¹æ¬¡")].Value); |
| | | HSourceInterID = 0; |
| | | HSourceEntryID = 0; |
| | | HSourceBillNo = ClsPub.isStrNull(grdMain.SelectedRows[j].Cells[Fun_GetCol("ç产订åå·")].Value); |
| | | HSourceBillNo = ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("ç产订åå·")].Value); |
| | | HSourceBillType = "3710"; |
| | | HBarcodeQtys = 0; |
| | | HBarcodeNo = 0; |
| | |
| | | HWhID = 0; |
| | | HSPID = 0; |
| | | HRemark = ""; |
| | | HMaterName = ClsPub.isStrNull(grdMain.SelectedRows[j].Cells[Fun_GetCol("ç©æåç§°")].Value); |
| | | HMaterModel = ClsPub.isStrNull(grdMain.SelectedRows[j].Cells[Fun_GetCol("è§æ ¼åå·")].Value); |
| | | HMaterName = ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("ç©æåç§°")].Value); |
| | | HMaterModel = ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("è§æ ¼åå·")].Value); |
| | | HPinfan = ""; |
| | | HMTONo = ""; |
| | | HCusID = 0; |
| | | HCusType = ""; |
| | | HEndDate = ClsPub.isDate(grdMain.SelectedRows[j].Cells[Fun_GetCol("æ¥æ")].Value); |
| | | HEndDate = ClsPub.isDate(grdMain.Rows[j].Cells[Fun_GetCol("æ¥æ")].Value); |
| | | HWorkLineName = ""; |
| | | HSeOrderBillNo = ""; |
| | | HInnerBillNo = ""; |
| | |
| | | ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID " + |
| | | ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo " + |
| | | ") values (" |
| | | + "'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString() |
| | | + "'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID1.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString() |
| | | + ",'" + HBatchNo2 + "'," + HSupID.ToString() + "," + HGroupID.ToString() + ",'" + ClsPub.CurUserName + "',getdate()," + HPrintQty.ToString() + "," + HQty2.ToString() |
| | | + ", " + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HWei + "'" |
| | | + ", " + HBarcodeQtys.ToString() + "," + HBarcodeNo.ToString() + "," + HDeptID.ToString() + "," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HRemark + "'" |
| | |
| | | oCn.RollBack(); |
| | | MessageBox.Show("æ¡ç çæå¤±è´¥ï¼" + e1.Message); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | private void Sub_SaveBill_TTM() |
| | | { |
| | | HInterID = DBUtility.ClsPub.CreateBillID_Prod(ModName, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | HInterID_TTM = DBUtility.ClsPub.CreateBillID_Prod(ModName1, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | HBillNo_TTM = DBUtility.ClsPub.CreateBillCode_Prod(ModName1, ref DBUtility.ClsPub.sExeReturnInfo, true);//å¾å°æ°åå· |
| | | string HMaterNumber = ""; |
| | | string HBatchNo = ""; |
| | | string HDate = ""; |
| | | string HYear = ""; |
| | | string HPeriod = ""; |
| | | string HDay = ""; |
| | | string HTMNumber = ""; |
| | | string HOrgNumber = ""; |
| | | DataSet Ds; |
| | | Int64 LSH = 0; //æµæ°´å· |
| | | string LSH2 = ""; //æµæ°´å·è½¬æ¢æå符 |
| | | double HZXQty = 0; //è£
ç®±æ°é |
| | | double HDDQty = 0; //è®¢åæ°é |
| | | double HBQty = 0; //ç®±æ° |
| | | int k = 0; |
| | | int n = 0; //å䏿¹çææ¡ç ä¸çç¬¬å æ¡ |
| | | string WeiShu = ""; //å°¾æ° |
| | | int LSHlen = 6; //æµæ°´å·é¿åº¦ |
| | | string TM = ""; //æ¡ç |
| | | for (int j = 0; j < grdMain.Rows.Count; j++) |
| | | { |
| | | HMaterNumber = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("ç©æä»£ç ")].Value); |
| | | HBatchNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("æ¹æ¬¡")].Value); |
| | | 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); |
| | | HOrgNumber = ClsPub.HOrgNumber; |
| | | |
| | | |
| | | //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); |
| | | |
| | | if (cmbHBarCodeType.Text == "å¯ä¸æ¡ç ") |
| | | { |
| | | 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]); |
| | | } |
| | | else if (cmbHBarCodeType.Text == "æ¹æ¬¡æ¡ç ") |
| | | { |
| | | TM = HOrgNumber + HMaterNumber + HBatchNo; |
| | | } |
| | | |
| | | |
| | | n = 0; |
| | | |
| | | LSH2 = LSH.ToString(); |
| | | while (LSH2.Length < LSHlen) //å¦ææµæ°´å·å°äº6使°åé¢è¡¥0 |
| | | { |
| | | LSH2 = "0" + LSH2; |
| | | } |
| | | if (cmbHBarCodeType.Text == "å¯ä¸æ¡ç ") |
| | | { |
| | | 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("æ¡å½¢ç ä¸è½ä¸ºç©ºï¼ä¸è½çææ¡ç ï¼"); |
| | | return; |
| | | } |
| | | string HWei = ""; //å°¾æ° |
| | | string HBarCode = ""; |
| | | string HBarCodeType = ""; |
| | | Int64 HMaterID1 = 0; |
| | | Int64 HAuxPropID = 0; |
| | | Int64 HUnitID = 0; |
| | | double HQty2 = 0; |
| | | string HBatchNo2 = ""; |
| | | Int64 HSupID = 0; |
| | | Int64 HGroupID = 0; |
| | | int HPrintQty = 0; |
| | | Int64 HSourceInterID = 0; |
| | | Int64 HSourceEntryID = 0; |
| | | string HSourceBillNo = ""; |
| | | string HSourceBillType = ""; |
| | | Int64 HBarcodeNo = 0; //æå· |
| | | Int64 HBarcodeQtys = 0; //æ»ææ° |
| | | Int64 HDeptID = 0; |
| | | Int64 HWhID = 0; |
| | | Int64 HSPID = 0; |
| | | string HRemark = ""; |
| | | string HMaterName = ""; |
| | | string HMaterModel = ""; |
| | | string HPinfan = ""; |
| | | string HMTONo = ""; |
| | | Int64 HCusID = 0; |
| | | string HCusType = ""; |
| | | DateTime HEndDate; |
| | | string HWorkLineName = ""; |
| | | string HSeOrderBillNo = ""; |
| | | string HInnerBillNo = ""; |
| | | try |
| | | { |
| | | oCn.BeginTran(); |
| | | HWei = WeiShu; |
| | | HBarCode = TM; |
| | | HBarCodeType = ClsPub.isStrNull(cmbHBarCodeType.Text); |
| | | HMaterID1 = ClsPub.isLong(grdMain.Rows[j].Cells[Fun_GetCol("HMaterID")].Value); |
| | | HAuxPropID = 0; |
| | | HUnitID = 0; |
| | | HQty2 = HZXQty; |
| | | HBatchNo2 = ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("æ¹æ¬¡")].Value); |
| | | HSourceInterID = 0; |
| | | HSourceEntryID = 0; |
| | | HSourceBillNo = ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("ç产订åå·")].Value); |
| | | HSourceBillType = "3710"; |
| | | HBarcodeQtys = 0; |
| | | HBarcodeNo = 0; |
| | | HSupID = 0; |
| | | HDeptID = 0; |
| | | HWhID = 0; |
| | | HSPID = 0; |
| | | HRemark = ""; |
| | | HMaterName = ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("ç©æåç§°")].Value); |
| | | HMaterModel = ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("è§æ ¼åå·")].Value); |
| | | HPinfan = ""; |
| | | HMTONo = ""; |
| | | HCusID = 0; |
| | | HCusType = ""; |
| | | HEndDate = ClsPub.isDate(grdMain.Rows[j].Cells[Fun_GetCol("æ¥æ")].Value); |
| | | HWorkLineName = ""; |
| | | HSeOrderBillNo = ""; |
| | | HInnerBillNo = ""; |
| | | oCn.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" + |
| | | ",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,HInterID " + |
| | | ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo " + |
| | | ") values (" |
| | | + "'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID1.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString() |
| | | + ",'" + HBatchNo2 + "'," + HSupID.ToString() + "," + HGroupID.ToString() + ",'" + ClsPub.CurUserName + "',getdate()," + HPrintQty.ToString() + "," + HQty2.ToString() |
| | | + ", " + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HWei + "'" |
| | | + ", " + 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 + "'," + HInterID.ToString() |
| | | + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HInnerBillNo + "')"); |
| | | oCn.RunProc("insert into Sc_PackUnionBillSub (HInterID,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo" + |
| | | ",HSourceBillType,HMaterID,HUnitID,HQty,HSourceID,HEquipID,HGroupID" + |
| | | ",HWorkerID,HScanDate,HBarCode,HBarCode_Pack,HStatus,HICMOEntryID " + |
| | | ") values (" |
| | | + HInterID_TTM + "," + j + ",0,0,''" |
| | | + ",'3710'," + HMaterID1.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString() + ",0,0,0" |
| | | + ", 0,getdate(),'" + HBarCode + "','" + TTM + "',0,0)"); |
| | | |
| | | DataSet DSet = oCn.RunProcReturn("select * from h_v_IF_BarCodeBillList Where HInterID=" + HInterID.ToString() + " and HBarCode like '%ZXM&' order by HItemID", "h_v_IF_BarCodeBillList", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //çæé¦è¡æ é¢ |
| | | if (DSet == null) |
| | | { |
| | | MessageBox.Show("没æè¿åä»»ä½ç»æ,æ¡ç ä¸åå¨ï¼" + DBUtility.ClsPub.sExeReturnInfo); |
| | | return; |
| | | } |
| | | // |
| | | grdList.DataSource = DSet.Tables[0].DefaultView; |
| | | |
| | | oCn.Commit(); |
| | | MessageBox.Show("æ¡ç çæå®æ¯ï¼"); |
| | | //grdSub.RowCount = 0; |
| | | //DisplayTM(); |
| | | |
| | | } |
| | | catch (Exception e1) |
| | | { |
| | | oCn.RollBack(); |
| | | MessageBox.Show("æ¡ç çæå¤±è´¥ï¼" + e1.Message); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | private void DisplayTM() |
| | | { |
| | | DataSet DSet = oCn.RunProcReturn("select * from h_v_IF_BarCodeBillList Where HinterID=" + HInterID.ToString() + " 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); |
| | | //ç»çº¿ |
| | |
| | | |
| | | private void cmdHSourceID_Click(object sender, EventArgs e) |
| | | { |
| | | Int64 HEmpID = 0; |
| | | HEmpID = Convert.ToInt64(txtHEmpID.Tag); |
| | | |
| | | |
| | | //MessageBox.Show(ClsPub.isStrNull(HEmpID)); |
| | | //string HEmpName = ""; |
| | | //HEmpName = ClsPub.isStrNull(txtHEmpID.Text); |
| | | |
| | | DAL.ClsGy_Source_View oSource = new DAL.ClsGy_Source_View(); |
| | | if (oSource.RefreshView()) |
| | | if (HEmpID != 0) |
| | | { |
| | | this.txtHSourceID.Text = oSource.oModel.HName; |
| | | this.txtHSourceID.Tag = oSource.oModel.HItemID.ToString(); |
| | | if (oSource.GetInfoByID_AoBang(HEmpID)) |
| | | { |
| | | this.txtHSourceID.Text = oSource.oModel.HName; |
| | | this.txtHSourceID.Tag = oSource.oModel.HItemID.ToString(); |
| | | // |
| | | Display(); |
| | | } |
| | | else |
| | | { |
| | | this.txtHSourceID.Text = ""; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | this.txtHSourceID.Text = ""; |
| | | |
| | | if (oSource.RefreshView()) |
| | | { |
| | | this.txtHSourceID.Text = oSource.oModel.HName; |
| | | this.txtHSourceID.Tag = oSource.oModel.HItemID.ToString(); |
| | | // |
| | | Display(); |
| | | } |
| | | else |
| | | { |
| | | this.txtHSourceID.Text = ""; |
| | | } |
| | | } |
| | | //if (oSource.RefreshView()) |
| | | //{ |
| | | // this.txtHSourceID.Text = oSource.oModel.HName; |
| | | // this.txtHSourceID.Tag = oSource.oModel.HItemID.ToString(); |
| | | // // |
| | | // Display(); |
| | | //} |
| | | |
| | | //DAL.ClsGy_WorkCenter_View oWork = new DAL.ClsGy_WorkCenter_View(); |
| | | //if (oWork.RefreshView()) |
| | | //{ |
| | | // this.txtHSourceID.Text = oWork.oModel.HName; |
| | | // this.txtHSourceID.Tag = oWork.oModel.HItemID.ToString(); |
| | | // // |
| | | // Display(); |
| | | // // |
| | | //} |
| | | //else |
| | | //{ |
| | | // this.txtHSourceID.Text = ""; |
| | | //} |
| | | } |
| | | |
| | | private void cmdHEmpID_Click(object sender, EventArgs e) |
| | |
| | | |
| | | for (int i = 0; i < grdMain.SelectedRows.Count; i++) |
| | | { |
| | | txtHICMOQty.Text = DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("è®¢åæ°é")].Value); |
| | | txtHZXQty.Text = DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("è®¢åæ°é")].Value); |
| | | } |
| | | HICMOQty = DBUtility.ClsPub.isDoule(txtHICMOQty.Text.Trim()); |
| | | HICMOQty = DBUtility.ClsPub.isDoule(txtHZXQty.Text.Trim()); |
| | | HMiniQty = DBUtility.ClsPub.isDoule(txtHMiniQty.Text.Trim()); |
| | | if (HMiniQty == 0) |
| | | { |
| | |
| | | txtHEmpID.Text = ""; |
| | | txtHICMOBillNo.Text = ""; |
| | | txtHICMOBillNo1.Text = ""; |
| | | txtHICMOQty.Text = ""; |
| | | txtHZXQty.Text = ""; |
| | | txtHMaterID.Text = ""; |
| | | txtHMaterID1.Text = ""; |
| | | txtHMiniQty.Text = ""; |
| | |
| | | grdList.DataSource = null; |
| | | grdSub.DataSource = null; |
| | | grdMain.DataSource = null; |
| | | txtHEmpID.Tag = 0; |
| | | } |
| | | |
| | | private void button2_Click(object sender, EventArgs e) |
| | | { |
| | | //è·åç½æ ¼ç¬¬ä¸è¡HInterIDçå¼ |
| | | Int64 HInterID = 0; |
| | | 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.isLong(grdMain.Rows[0].Cells["HInterID"].Value); |
| | | //} |
| | | //else |
| | | //{ |
| | | |
| | | //} |
| | | if (DSBefore == null || DSBefore.Tables[0].Rows.Count == 0) |
| | | //if (DSet == null|| DSet.Tables[0].Rows.Count == 0) |
| | | { |
| | | MessageBox.Show("没æä¸ä¸ä¸ªç©æ,妿éè¦è¯·æ¾æºä¿®ï¼" + DBUtility.ClsPub.sExeReturnInfo); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | grdMain.DataSource = DSBefore.Tables[0].DefaultView; |
| | | 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); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | private void button3_Click(object sender, EventArgs e) |
| | | { |
| | | //æ ¹æ® |
| | | Int64 HInterID = 0; |
| | | //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) |
| | | //if (DSet == null|| DSet.Tables[0].Rows.Count == 0) |
| | | { |
| | | MessageBox.Show("没æä¸ä¸ä¸ªç©æ,妿éè¦è¯·æ¾æºä¿®ï¼" + DBUtility.ClsPub.sExeReturnInfo); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | grdMain.DataSource = DSBefore.Tables[0].DefaultView; |
| | | 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); |
| | | } |
| | | |
| | | //è¶
é¢æå° |
| | | private void button7_Click(object sender, EventArgs e) |
| | | { |
| | | //æ ¹æ®æ¬ç®±æ°é æ¥ åé
å° æ¯ä¸ªç产订åä¸ï¼å¹¶ä¸å
许è¶
è¿è®¢åæ°é ï¼åé
æ¶ è¦èè 订åå©ä½æ°éå·²ç»æ¯ è´æ°çæ
åµï¼ |
| | | //1.夿æ¬ç®±æ°é å¿
须大äº0 |
| | | double HZXQty = 0;//æ´ç®±æ°é |
| | | HZXQty = ClsPub.isDoule(txtHZXQty.Text); |
| | | if (HZXQty <= 0) |
| | | { |
| | | MessageBox.Show("请è¾å
¥æ´ç®±æ°éï¼"); |
| | | return; |
| | | } |
| | | //2.å·æ°ç½æ ¼ |
| | | //Display(); |
| | | //3.循ç¯ç½æ ¼ï¼ç´¯è®¡å
¨é¨å©ä½æ°éï¼å¤ææ¯å¦ å©ä½æ°é å°äº æ¬ç®±æ°éï¼å¦æ 大äºåæ¥é éåºã |
| | | double sumLeftQty = 0; |
| | | for (int i = 0; i < grdMain.Rows.Count; i++) |
| | | { |
| | | if ( DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["çäº§è®¢åæ°é"].Value)>0) |
| | | { |
| | | sumLeftQty = sumLeftQty + DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["çäº§è®¢åæ°é"].Value); |
| | | } |
| | | else |
| | | { |
| | | } |
| | | } |
| | | if(sumLeftQty>= HZXQty ) |
| | | { |
| | | MessageBox.Show("å©ä½æ°éå¤§äºæ¬ç®±æ°éï¼ä¸è½è¶
颿å°ï¼è¯·ç¨æ®éæå°åè½ã"); |
| | | return; |
| | | } |
| | | //4.ææ´ç®±æ°é åé
å° ç½æ ¼ä¸é¢çæ¯ä¸ä¸ª ç产订åä¸å»ã 循ç¯ç½æ ¼ |
| | | for (int i = 0; i < grdMain.Rows.Count; i++) |
| | | { |
| | | if (HZXQty > DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["çäº§è®¢åæ°é"].Value)) |
| | | { |
| | | if (i == grdMain.Rows.Count - 1) |
| | | { |
| | | grdMain.Rows[i].Cells["æ¬æ¬¡æ°é"].Value = HZXQty; |
| | | } |
| | | else |
| | | { |
| | | HZXQty = HZXQty - DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["çäº§è®¢åæ°é"].Value); |
| | | grdMain.Rows[i].Cells["æ¬æ¬¡æ°é"].Value = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["çäº§è®¢åæ°é"].Value); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //grdMain.Rows[i].Cells["æ¬æ¬¡æ°é"].Value = HZXQty; |
| | | break; |
| | | } |
| | | } |
| | | Sub_SaveBarCode(); |
| | | // |
| | | } |
| | | |
| | | private void cmdESOP_Click(object sender, EventArgs e) |
| | | { |
| | | Sc_MESNowWorkBill_Fast oSc_MESNowWorkBill_Fast = new Sc_MESNowWorkBill_Fast(); |
| | | oSc_MESNowWorkBill_Fast.txtHICMOBillNo.Text = ""; |
| | | oSc_MESNowWorkBill_Fast.txtHMaterID.Text =txtHMaterID.Text; |
| | | oSc_MESNowWorkBill_Fast.txtHName.Text = ClsPub.isStrNull(grdMain.Rows[0].Cells[Fun_GetCol("ç©æåç§°")].Value); |
| | | oSc_MESNowWorkBill_Fast.txtHModel.Text = ClsPub.isStrNull(grdMain.Rows[0].Cells[Fun_GetCol("è§æ ¼åå·")].Value); |
| | | oSc_MESNowWorkBill_Fast.Show(); |
| | | |
| | | } |
| | | |
| | | private void txtHBarCode_KeyDown(object sender, KeyEventArgs e) |
| | | { |
| | | if(e.KeyCode==Keys.Enter) |
| | | { |
| | | // |
| | | //è·å第ä¸è¡æ¡å½¢ç è¿è¡æå° |
| | | DataSet DSet = oCn.RunProcReturn("select * from h_v_IF_BarCodeBillList_CS Where æ¡ç ç¼å·='"+ txtHBarCode.Text +"' and æ¡ç ç±»å = 'æçæ¡ç '", "h_v_IF_BarCodeBillList_CS", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //çæé¦è¡æ é¢ |
| | | if (DSet == null) |
| | | { |
| | | MessageBox.Show("没æè¿åä»»ä½ç»æ,æ¡ç ä¸åå¨ï¼" + DBUtility.ClsPub.sExeReturnInfo); |
| | | return; |
| | | } |
| | | // |
| | | grdList.DataSource = DSet.Tables[0].DefaultView; |
| | | //å»ç» |
| | | int FrCol = 0; |
| | | string s = "æ¯"; |
| | | DBUtility.Xt_BaseBillFun.DisplayGrid(grdList, this.Name + "grdList", s, FrCol); |
| | | // |
| | | //夿æ¯å¦å·²ç»çææ¡ç |
| | | if (DBUtility.ClsPub.isStrNull(grdList.Rows[0].Cells[Fun_GetColList("æ¡ç ç¼å·")].Value) == "") |
| | | { |
| | | MessageBox.Show("æ¡ç æªçæï¼è¯·å
çææ¡ç ååé¢è§ï¼"); |
| | | return; |
| | | } |
| | | //éæ©æå°æ¨¡æ¿ |
| | | Sub_SetReport("注å¡ç©ææ ç¾"); |
| | | Report.Print(false); |
| | | Thread.Sleep(1000); |
| | | } |
| | | } |
| | | |
| | | private void label14_Click(object sender, EventArgs e) |
| | | { |
| | | |
| | | } |
| | | } |
| | | } |