| | |
| | | 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(); |
| | | // |
| | | 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 æ¥æ<='" + 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) |
| | | { |
| | |
| | | Display(); |
| | | } |
| | | |
| | | string TTM = ""; //ææ¡ç |
| | | string HTTMNumber = ""; |
| | | string HICMOBillNo = ""; //ç产订åå· |
| | | int TLSH = 0; |
| | | string TLSH2 = ""; |
| | | string HOrgNumber = ""; |
| | | |
| | | |
| | | |
| | | private void button4_Click(object sender, EventArgs e) |
| | | { |
| | | //1.è·åçé¢ä¸é¢æ´ç®±æ°éæ¡è¾å
¥çæ°é èµå¼ç»åé å¹¶å·æ°ç½æ ¼ |
| | | double HBarCodeQty = 0; |
| | | double HZXQty = 0; |
| | | HZXQty = ClsPub.isDoule(txtHZXQty.Text); |
| | | if (HZXQty ==0) |
| | | { |
| | | MessageBox.Show("请è¾å
¥æ´ç®±æ°éï¼"); |
| | | return; |
| | | } |
| | | Display(); |
| | | //2.è·åç½æ ¼éä¸è¡ç©æID |
| | | //int a = grdMain.CurrentRow.Index; |
| | | //long HMaterID = 0; |
| | | ////HMaterID = DBUtility.ClsPub.isLong(grdMain.Rows[a].Cells[Fun_GetCol("HMaterID")].Value); |
| | | // if (HMaterID == 0) |
| | | // { |
| | | // MessageBox.Show("没æéä¸ä»»ä½è®°å½ï¼"); |
| | | // return; |
| | | // } |
| | | //3.å®ä¹æ¯å¦ç»æçåé |
| | | int Mul = 0; |
| | | //4.æ ¹æ®åæ®ç±»åè·åæ¬æ¬¡æ¡ç 主å
ç HInterID |
| | | HInterID = DBUtility.ClsPub.CreateBillID_Prod(ModName, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | for (int i = 0; i < grdMain.Rows.Count; i++) |
| | | { |
| | | |
| | | //è·åç½æ ¼é颿¯ä¸è¡è®¢å对åºçè®¢åæ°é |
| | | double HDDQty = 0; |
| | | HDDQty = DBUtility.ClsPub.isDoule(grdMain.Rows[grdMain.Rows[i].Index].Cells[Fun_GetCol("è®¢åæ°é")].Value); |
| | | |
| | | |
| | | //è·åå½åç³»ç»ç»éç»ç»ä»£ç |
| | | HOrgNumber = ClsPub.HOrgNumber; |
| | | |
| | | |
| | | |
| | | |
| | | //èªå¨å¹é
é»è¾ å¤æè®¢åæ°éæ¯å¦å¤§äºæ´ç®±æ°é å¦æè®¢åæ°éå¤§äºæ´ç®±æ°é ç´æ¥çæå¯ä¸ç |
| | | //å¦æè®¢åæ°éå°äºæ´ç®±æ°é å循ç¯çæå¯ä¸ç çæå¯¹åºçææ¡ç |
| | | if (HDDQty >= HZXQty) |
| | | { |
| | | HBarCodeQty = HZXQty; |
| | | this.Sub_SaveBill_TTM(); |
| | | Display(); |
| | | Mul = Mul + 1; |
| | | break; |
| | | } |
| | | else if(HDDQty < HZXQty) |
| | | { |
| | | HBarCodeQty = HDDQty; |
| | | HZXQty = HZXQty - HDDQty; |
| | | this.Sub_SaveBill_TTM(); |
| | | Mul = Mul + 1; |
| | | continue; |
| | | } |
| | | |
| | | //妿Mul>1 æ°å¢ç»æå主表 |
| | | |
| | | } |
| | | |
| | | if (Mul > 1) |
| | | { |
| | | //HICMOBillNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[Fun_GetCol("ç产订åå·")].Value); |
| | | DataSet DS1; |
| | | HTTMNumber = HOrgNumber + HICMOBillNo; |
| | | DS1 = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HTTMNumber + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· |
| | | TLSH = ClsPub.isInt(DS1.Tables[0].Rows[0][0]); |
| | | TLSH2 = TLSH.ToString(); |
| | | TTM = HTTMNumber + TLSH2; |
| | | HInterID_TTM = DBUtility.ClsPub.CreateBillID_Prod(ModName1, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | HBillNo_TTM = DBUtility.ClsPub.CreateBillCode_Prod(ModName1, ref DBUtility.ClsPub.sExeReturnInfo, true);//å¾å°æ°åå· |
| | | |
| | | string HDate = ""; |
| | | string HYear = ""; |
| | | string HPeriod = ""; |
| | | string HDay = ""; |
| | | 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); |
| | | |
| | | 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 + "'" |
| | | + ", " + HBillNo_TTM.ToString() + ",1,''," + TTM.ToString() + ",0,0,0" |
| | | + ",0,1,0,0,0,0,'','')"); |
| | | } |
| | | |
| | | |
| | | //3.å
å¤æç©ææ¯å¦ä¸è´ 妿ä¸è´å¼å§å¾ªç¯ç½æ ¼ |
| | | for (int i = 0; i < grdMain.Rows.Count; i++) |
| | | { |
| | | //long HGrdMaterID = 0; |
| | | //HGrdMaterID = DBUtility.ClsPub.isLong(grdMain.Rows[grdMain.Rows[i].Index].Cells[Fun_GetCol("HMaterID")].Value); |
| | | //if (HGrdMaterID == HMaterID) |
| | | //{ |
| | | // double HDDQty = 0; |
| | | // HDDQty = DBUtility.ClsPub.isDoule(grdMain.Rows[grdMain.Rows[i].Index].Cells[Fun_GetCol("è®¢åæ°é")].Value); |
| | | // //å¦æå¾ªç¯ç该è¡è®°å½çè®¢åæ°éå·²ç»å¤§äºçäºæ¬æ¬¡è£
ç®±æ°é åç´æ¥çæå¯ä¸ç å¹¶ä¸å·æ°ç½æ ¼ å·æ°æ¡ç ä¿¡æ¯é¡µ |
| | | // if (HDDQty >= HZXQty) |
| | | // { |
| | | // double HBarCodeQty = 0; |
| | | // HBarCodeQty = HZXQty; |
| | | // this.Sub_SaveBill(); |
| | | // Display(); |
| | | // } |
| | | // //妿æ¹è¡è®°å½è®¢åæ°éå°äºæ¬æ¬¡è£
ç®±æ°é åç»§ç»å¾ªç¯ èµ°çæææ¡ç æ¹æ³ |
| | | // else |
| | | // { |
| | | // //æ¥åºç¬¦åæ¡ä»¶çéä¸è¿æ¡æ°éè·è£
ç®±æ°éçå·®å¼å¼ |
| | | // double HCYQty = 0; |
| | | // HCYQty = HZXQty - DBUtility.ClsPub.isLong(grdMain.Rows[grdMain.Rows[i].Index].Cells[Fun_GetCol("è®¢åæ°é")].Value); |
| | | |
| | | // } |
| | | |
| | | //} |
| | | //else |
| | | //{ |
| | | |
| | | //} |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | private void Sub_SaveBill() |
| | | { |
| | | HInterID = DBUtility.ClsPub.CreateBillID_Prod(ModName, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | string HMaterNumber = ""; |
| | |
| | | DataSet Ds; |
| | | int 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.isInt(txtHBQty.Text); |
| | | HZXQty = ClsPub.isDoule(txtHZXQty.Text); |
| | | HDDQty = DBUtility.ClsPub.isDoule(grdMain.Rows[j].Cells[Fun_GetCol("è®¢åæ°é")].Value); |
| | | |
| | | |
| | | 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; |
| | | int 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.isInt(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.isInt(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 == "å¯ä¸æ¡ç ") |
| | | { |
| | | //æ¡ç ç¼å· = æ¡ç åç¼ + æµæ°´å· |
| | | 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)"); |
| | | |
| | | oCn.Commit(); |
| | | MessageBox.Show("æ¡ç çæå®æ¯ï¼"); |
| | | //grdSub.RowCount = 0; |
| | | DisplayTM(); |
| | | } |
| | | catch (Exception e1) |
| | | { |
| | | oCn.RollBack(); |
| | | MessageBox.Show("æ¡ç çæå¤±è´¥ï¼" + e1.Message); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | private void DisplayTM() |
| | |
| | | |
| | | private void cmdHSourceID_Click(object sender, EventArgs e) |
| | | { |
| | | DAL.ClsGy_Source_View oSource = new DAL.ClsGy_Source_View(); |
| | | if (oSource.RefreshView()) |
| | | DAL.ClsGy_WorkCenter_View oWork = new DAL.ClsGy_WorkCenter_View(); |
| | | if (oWork.RefreshView()) |
| | | { |
| | | this.txtHSourceID.Text = oSource.oModel.HName; |
| | | this.txtHSourceID.Tag = oSource.oModel.HItemID.ToString(); |
| | | this.txtHSourceID.Text = oWork.oModel.HName; |
| | | this.txtHSourceID.Tag = oWork.oModel.HItemID.ToString(); |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | 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 = ""; |
| | |
| | | grdSub.DataSource = null; |
| | | grdMain.DataSource = null; |
| | | } |
| | | |
| | | private void button2_Click(object sender, EventArgs e) |
| | | { |
| | | //è·åç½æ ¼ç¬¬ä¸è¡HInterIDçå¼ |
| | | Int64 HInterID = 0; |
| | | HInterID = DBUtility.ClsPub.isInt(grdMain.Rows[0].Cells[Fun_GetCol("HInterID")].Value); |
| | | DataSet DSBefore; |
| | | DSBefore = SubCn.RunProcReturn("exec h_p_PreviousMater "+ HInterID, "h_p_PreviousMater", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | grdMain.DataSource = DSBefore.Tables[0].DefaultView; |
| | | } |
| | | |
| | | private void button3_Click(object sender, EventArgs e) |
| | | { |
| | | //æ ¹æ® |
| | | Int64 HInterID = 0; |
| | | HInterID = DBUtility.ClsPub.isInt(grdMain.Rows[0].Cells[Fun_GetCol("HInterID")].Value); |
| | | DataSet DSBefore; |
| | | DSBefore = SubCn.RunProcReturn("exec h_p_NextMater " + HInterID, "h_p_NextMater", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | grdMain.DataSource = DSBefore.Tables[0].DefaultView; |
| | | } |
| | | |
| | | private void button7_Click(object sender, EventArgs e) |
| | | { |
| | | |
| | | } |
| | | } |
| | | } |