| | |
| | | { |
| | | // |
| | | oCn.BeginTran(); |
| | | //æ´æ°ä¸»è¡¨ |
| | | oCn.RunProc("UpDate Sc_ProcessExchangeBillMain set " + |
| | | string sql = string.Format(@"UpDate Sc_ProcessExchangeBillMain set " + |
| | | " HBillNo='" + omodel.HBillNo + "'" + //åºå®èµå¼=============== |
| | | ",HDate='" + omodel.HDate + "'" + |
| | | ",HYear='" + omodel.HYear.ToString() + "'" + |
| | | ",HPRDORGID='" + omodel.HPRDORGID.ToString() + "'" + |
| | | ",HPeriod='" + omodel.HPeriod.ToString() + "'" + |
| | | ",HRemark='" + omodel.HRemark + "'" + |
| | | ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" + |
| | |
| | | ",HMaterTexture='" + omodel.HMaterTexture + "'" + |
| | | ",HProductNum='" + omodel.HProductNum + "'" + |
| | | ",HVerNum='" + omodel.HVerNum + "'" + |
| | | ",HWorkBillSortNo='" + omodel.HWorkBillSortNo + "'" + |
| | | //å å
¥ç产类å |
| | | ",HWorkTypeNum='" + omodel.HWorkTypeNum + "'" + |
| | | " where HInterID=" + lngBillKey.ToString()); |
| | | //æ´æ°ä¸»è¡¨ |
| | | oCn.RunProc(sql); |
| | | //å é¤å
³è |
| | | DeleteRelation(ref sReturn, lngBillKey); |
| | | //å é¤å表 |
| | |
| | | omodel.HInterID = lngBillKey; |
| | | foreach (Model.ClsSc_ProcessExchangeBillSub oSub in DetailColl) |
| | | { |
| | | oCn.RunProc("Insert into Sc_ProcessExchangeBillSub " + |
| | | |
| | | string sql1 = string.Format(@"Insert into Sc_ProcessExchangeBillSub " + |
| | | " (HInterID,HEntryID,HBillNo_bak," + |
| | | "HCloseMan,HEntryCloseDate,HCloseType,HRemark," + |
| | | "HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType," + |
| | |
| | | ",HLastProc,HKeyProc,HFstProc,HICMOInterID,HICMOBillNo,HWWOrderInterID," + |
| | | "HWWOrderEntryID,HWWOrderBillNo,HReportQty,HBackProc" + |
| | | ",HSupID,HSupFlag,HOverRate,HMaxQty,HTechnologyParameter,HProcCheckNote,HPicNum" + |
| | | ",HMouldNo,HProcWorkNum" + |
| | | ",HMouldNo,HProcWorkNum,HSeOrderInterID,HSeOrderEntryID" + |
| | | ") values(" |
| | | + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + omodel.HBillNo + "'" + |
| | | ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + |
| | | "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," |
| | | + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + "," + oSub.HRelationQty_In.ToString() + "," |
| | | "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," |
| | | + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + "," + oSub.HRelationQty_In.ToString() + "," |
| | | + oSub.HRelationQty_Out.ToString() + "," + oSub.HRelationQty_WWOrder.ToString() + "," + oSub.HRelationQty_Bad.ToString() + |
| | | "," + oSub.HProcNo.ToString() + "," + oSub.HProcID.ToString() + ",'" + oSub.HProcNumber + "','" + oSub.HWorkRemark + "'" + |
| | | "," + oSub.HCenterID.ToString() + "," + oSub.HDeptID.ToString() + ",'" + oSub.HDeptNumber + "'," + oSub.HGroupID.ToString() + |
| | | ",'" + oSub.HGroupNumber + "'," + oSub.HWorkerID.ToString() + ",'" + oSub.HWorkerNumber + "'," + oSub.HSourceID.ToString() + |
| | | ",'" + oSub.HQty + "','" + oSub.HTimeUnit + "','" + oSub.HPlanWorkTimes + "','" + oSub.HPlanBeginDate.ToShortDateString() + "'" + |
| | | ",'" + oSub.HPlanEndDate.ToShortDateString() + "','" + oSub.HRelBeginDate.ToShortDateString() + "','" + oSub.HRelEndDate.ToShortDateString() + "'" + |
| | | ",'" + oSub.HQty + "','" + oSub.HTimeUnit + "','" + oSub.HPlanWorkTimes + "','" + omodel.HPlanBeginDate.ToShortDateString() + "'" + |
| | | ",'" + omodel.HPlanEndDate.ToShortDateString() + "',getdate(),getdate()" + |
| | | "," + oSub.HReadyTime.ToString() + "," + oSub.HQueueTime.ToString() + "," + oSub.HMoveTime.ToString() + "," + oSub.HBeginDayQty.ToString() + |
| | | "," + oSub.HBeginFixQty.ToString() + "," + oSub.HFixWorkDays.ToString() + "," + oSub.HTrunWorkDays.ToString() + "," + oSub.HReadyTimes.ToString() + |
| | | "," + oSub.HMyWorkDays.ToString() + "," + oSub.HOutPrice.ToString() + "," + oSub.HOutMoney.ToString() + "," + oSub.HPassRate.ToString() + ",'" + oSub.HLastProc + "'" + |
| | | ",'" + oSub.HKeyProc + "','" + oSub.HFstProc + "'," + oSub.HICMOInterID.ToString() + ",'" + oSub.HICMOBillNo + "'," + oSub.HWWOrderInterID.ToString() + |
| | | "," + oSub.HWWOrderEntryID.ToString() + ",'" + oSub.HWWOrderBillNo + "'," + oSub.HReportQty.ToString() + "," + Convert.ToString(oSub.HBackProc ? 1 : 0) + |
| | | "," + oSub.HSupID.ToString() + "," + Convert.ToString(oSub.HSupFlag ? 1 : 0) + "," + oSub.HOverRate.ToString() + "," + oSub.HMaxQty.ToString() + ",'" + oSub.HTechnologyParameter + "','" + oSub.HProcCheckNote + "','" + oSub.HPicNum + "'" + |
| | | ",'" + oSub.HMouldNo.ToString() + "','" + oSub.HProcWorkNum.ToString() + "'" + |
| | | ",'" + oSub.HMouldNo.ToString() + "','" + oSub.HProcWorkNum.ToString() + "','" + DBUtility.ClsPub.isStrNull(omodel.HSeOrderInterID) + "','" + DBUtility.ClsPub.isStrNull(omodel.HSeOrderEntryID) + "'"+ |
| | | ") "); |
| | | oCn.RunProc(sql1); |
| | | } |
| | | // |
| | | oCn.RunProc("exec h_p_Sc_ProcessExchangeBill_SetRemark " + omodel.HInterID.ToString()); //设置 夿³¨ 为 å·¥èºæµ |
| | |
| | | //æ°å¢åæ® |
| | | public override bool AddBill(ref string sReturn) |
| | | { |
| | | string sErr = ""; |
| | | try |
| | | { |
| | | //å¾å°mainid |
| | |
| | | //omodel.HProjectNum = ""; |
| | | //omodel.HProjectNum = GetNewCodeByNum(omodel.HInterID, 1, 3).ToString(); |
| | | // |
| | | |
| | | oCn.BeginTran(); |
| | | //主表 |
| | | oCn.RunProc("Insert Into Sc_ProcessExchangeBillMain " + |
| | |
| | | ",HProdMaterName,HCusName,HWorkRemark,HImportNote,HMaterNumber_A" + |
| | | ",HMaterNumber_B,HMaterNumber_C,HMaterNumber_D,HProdType,HMaterShortName" + |
| | | ",HMaterIDA,HMaterIDB,HMaterIDC,HMaterIDD,HICMOEntryID" + |
| | | ",HPicNumVer,HPicNumAssemble,HMaterTexture,HProductNum,HVerNum" + |
| | | ",HPicNumVer,HPicNumAssemble,HMaterTexture,HProductNum,HVerNum,HPRDORGID,HBLFlag,HWorkBillSortNo" + |
| | | ") " + |
| | | " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker + "',getdate()," + "" + (omodel.HPrevMainSourceInterID == 0 ? omodel.HInterID : omodel.HPrevMainSourceInterID) + |
| | | "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + omodel.HBatchNo + "'," + omodel.HMainMaterID.ToString() + "," + omodel.HKeyMaterID.ToString() + "," + omodel.HNo.ToString() + ",'" + omodel.HOrderProcNO + "'" + |
| | |
| | | ",'" + omodel.HProdMaterName + "','" + omodel.HCusName + "','" + omodel.HWorkRemark + "','" + omodel.HImportNote + "','" + omodel.HMaterNumber_A + "'" + |
| | | ",'" + omodel.HMaterNumber_B + "','" + omodel.HMaterNumber_C + "','" + omodel.HMaterNumber_D + "','" + omodel.HProdType + "','" + omodel.HMaterShortName + "'" + |
| | | ",'" + omodel.HMaterIDA + "','" + omodel.HMaterIDB + "','" + omodel.HMaterIDC + "','" + omodel.HMaterIDD + "'," + omodel.HICMOEntryID + |
| | | ",'" + omodel.HPicNumVer + "','" + omodel.HPicNumAssemble + "','" + omodel.HMaterTexture + "','" + omodel.HProductNum + "','" + omodel.HVerNum + "'" + |
| | | ") "); |
| | | ",'" + omodel.HPicNumVer + "','" + omodel.HPicNumAssemble + "','" + omodel.HMaterTexture + "','" + omodel.HProductNum + "','" + omodel.HVerNum + "','"+ omodel.HPRDORGID+ "','"+omodel.HBLFlag+"','" + omodel.HWorkBillSortNo + |
| | | "') "); |
| | | sErr = sErr + "1;"; |
| | | //æå
¥å表 |
| | | foreach (Model.ClsSc_ProcessExchangeBillSub oSub in DetailColl) |
| | | { |
| | | oCn.RunProc("Insert into Sc_ProcessExchangeBillSub " + |
| | | string sql1 = string.Format(@"Insert into Sc_ProcessExchangeBillSub " + |
| | | " (HInterID,HEntryID,HBillNo_bak," + |
| | | "HCloseMan,HEntryCloseDate,HCloseType,HRemark," + |
| | | "HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney," + |
| | | "HProcNo,HProcID,HProcNumber,HWorkRemark,HCenterID,HDeptID" + |
| | | ",HDeptNumber,HGroupID,HGroupNumber,HWorkerID,HWorkerNumber,HSourceID" + |
| | | ",HQty,HTimeUnit,HPlanWorkTimes,HPlanBeginDate,HPlanEndDate,HRelBeginDate" + |
| | | "HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType," + |
| | | "HRelationQty,HRelationMoney,HRelationQty_In," + |
| | | "HRelationQty_Out,HRelationQty_WWOrder,HRelationQty_Bad," + |
| | | "HProcNo,HProcID,HProcNumber,HWorkRemark," + |
| | | "HCenterID,HDeptID" + |
| | | ",HDeptNumber,HGroupID," + |
| | | "HGroupNumber,HWorkerID,HWorkerNumber,HSourceID" + |
| | | ",HQty,HTimeUnit,HPlanWorkTimes,HPlanBeginDate," + |
| | | "HPlanEndDate,HRelBeginDate" + |
| | | ",HRelEndDate,HReadyTime,HQueueTime,HMoveTime,HBeginDayQty,HBeginFixQty" + |
| | | ",HFixWorkDays,HTrunWorkDays,HReadyTimes,HMyWorkDays,HOutPrice,HOutMoney,HPassRate" + |
| | | ",HLastProc,HKeyProc,HFstProc,HICMOInterID,HICMOBillNo,HWWOrderInterID,HWWOrderEntryID,HWWOrderBillNo,HReportQty,HBackProc" + |
| | | ",HFixWorkDays,HTrunWorkDays,HReadyTimes," + |
| | | "HMyWorkDays,HOutPrice,HOutMoney,HPassRate" + |
| | | ",HLastProc,HKeyProc,HFstProc,HICMOInterID,HICMOBillNo,HWWOrderInterID," + |
| | | "HWWOrderEntryID,HWWOrderBillNo,HReportQty,HBackProc" + |
| | | ",HSupID,HSupFlag,HOverRate,HMaxQty,HTechnologyParameter,HProcCheckNote,HPicNum" + |
| | | ",HMouldNo,HProcWorkNum" + |
| | | ",HMouldNo,HProcWorkNum,HSeOrderInterID,HSeOrderEntryID" + |
| | | ") values(" |
| | | + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + omodel.HBillNo + "'" + |
| | | ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + |
| | | "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + |
| | | "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," |
| | | + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + "," + oSub.HRelationQty_In.ToString() + "," |
| | | + oSub.HRelationQty_Out.ToString() + "," + oSub.HRelationQty_WWOrder.ToString() + "," + oSub.HRelationQty_Bad.ToString() + |
| | | "," + oSub.HProcNo.ToString() + "," + oSub.HProcID.ToString() + ",'" + oSub.HProcNumber + "','" + oSub.HWorkRemark + "'" + |
| | | "," + oSub.HCenterID.ToString() + "," + oSub.HDeptID.ToString() + ",'" + oSub.HDeptNumber + "'," + oSub.HGroupID.ToString() + |
| | | ",'" + oSub.HGroupNumber + "'," + oSub.HWorkerID.ToString() + ",'" + oSub.HWorkerNumber + "'," + oSub.HSourceID.ToString() + |
| | | ",'" + oSub.HQty + "','" + oSub.HTimeUnit + "','" + oSub.HPlanWorkTimes + "','" + oSub.HPlanBeginDate.ToShortDateString() + "'" + |
| | | ",'" + oSub.HPlanEndDate.ToShortDateString() + "','" + oSub.HRelBeginDate.ToShortDateString() + "','" + oSub.HRelEndDate.ToShortDateString() + "'" + |
| | | ",'" + oSub.HQty + "','" + oSub.HTimeUnit + "','" + oSub.HPlanWorkTimes + "','" + omodel.HPlanBeginDate.ToShortDateString() + "'" + |
| | | ",'" + omodel.HPlanEndDate.ToShortDateString() + "',getdate(),getdate()" + |
| | | "," + oSub.HReadyTime.ToString() + "," + oSub.HQueueTime.ToString() + "," + oSub.HMoveTime.ToString() + "," + oSub.HBeginDayQty.ToString() + |
| | | "," + oSub.HBeginFixQty.ToString() + "," + oSub.HFixWorkDays.ToString() + "," + oSub.HTrunWorkDays.ToString() + "," + oSub.HReadyTimes.ToString() + |
| | | "," + oSub.HMyWorkDays.ToString() + "," + oSub.HOutPrice.ToString() + "," + oSub.HOutMoney.ToString() + "," + oSub.HPassRate.ToString() + ",'" + oSub.HLastProc + "'" + |
| | | ",'" + oSub.HKeyProc + "','" + oSub.HFstProc + "'," + oSub.HICMOInterID.ToString() + ",'" + oSub.HICMOBillNo + "'," + oSub.HWWOrderInterID.ToString() + |
| | | "," + oSub.HWWOrderEntryID.ToString() + ",'" + oSub.HWWOrderBillNo + "'," + oSub.HReportQty.ToString() + "," + Convert.ToString(oSub.HBackProc ? 1 : 0) + |
| | | "," + oSub.HSupID.ToString() + "," + Convert.ToString(oSub.HSupFlag ? 1 : 0) + "," + oSub.HOverRate.ToString() + "," + oSub.HMaxQty.ToString() + ",'" + oSub.HTechnologyParameter + "','" + oSub.HProcCheckNote + "','"+ oSub.HPicNum + "'" + |
| | | ",'" + oSub.HMouldNo.ToString() + "','" + oSub.HProcWorkNum.ToString() + "'" + |
| | | "," + oSub.HSupID.ToString() + "," + Convert.ToString(oSub.HSupFlag ? 1 : 0) + "," + oSub.HOverRate.ToString() + "," + oSub.HMaxQty.ToString() + ",'" + oSub.HTechnologyParameter + "','" + oSub.HProcCheckNote + "','" + oSub.HPicNum + "'" + |
| | | ",'" + oSub.HMouldNo.ToString() + "','" + oSub.HProcWorkNum.ToString() + "','" + DBUtility.ClsPub.isStrNull( omodel.HSeOrderInterID) + "','" + DBUtility.ClsPub.isStrNull(omodel.HSeOrderEntryID) + "'" + |
| | | ") "); |
| | | sErr = sErr + sql1 + "2;"; |
| | | oCn.RunProc(sql1); |
| | | sErr = sErr + "2;"; |
| | | //æ´æ°æéæµè½¬å¡æ°é |
| | | if (!oSub.HBackProc) |
| | | { |
| | |
| | | |
| | | } |
| | | } |
| | | sErr = sErr + "3;"; |
| | | } |
| | | |
| | | oCn.RunProc("exec h_p_Sc_ProcessExchangeBill_SetRemark " + omodel.HInterID.ToString()); //设置 夿³¨ 为 å·¥èºæµ |
| | | sErr = sErr + "4;"; |
| | | oCn.RunProc("exec h_p_Sc_ProcessExchangeBill_SetUpdate " + omodel.HInterID.ToString()); //设置 æ«é é¦é 转 çä¿¡æ¯ |
| | | sErr = sErr + "5;"; |
| | | DataSet ds = new DataSet(); |
| | | //设置æ¡ç å· åå¡« é¢ææ¹æ¬¡ |
| | | ds = oCn.RunProcReturn("exec h_p_Mes_ProcessExchangeBackBarCode " + omodel.HInterID.ToString(), "h_p_Mes_ProcessExchangeBackBarCode"); |
| | |
| | | return false; |
| | | } |
| | | |
| | | sErr = sErr + "6;"; |
| | | |
| | | //oCn.RunProc("exec h_p_Sc_ProcessExchangeBill_SetDate " + omodel.HInterID.ToString()); //åå¡« å¼å·¥å®å·¥æ¥æ |
| | | //oCn.RunProc("exec h_p_Sc_ProcessExchangeBill_RelationQty " + omodel.HInterID.ToString() + ",1"); //è¿å·¥æµè½¬å¡ åå æåæ°é åå¡«ä»»å¡å æµè½¬å¡æ°é åå¡«ä»»å¡åä¸éæ°é |
| | | |
| | | |
| | | //æ§å¶å
³èæ°é |
| | | ds = null; |
| | | ds = oCn.RunProcReturn("exec h_p_Sc_ProcessExchangeBill_Checkqty " + omodel.HInterID.ToString(), "h_p_Sc_ProcessExchangeBill_Checkqty"); |
| | |
| | | return false; |
| | | } |
| | | |
| | | sErr = sErr + "7;"; |
| | | |
| | | // |
| | | sReturn = "æ°å¢åæ®æåï¼"; |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sReturn = e.Message; |
| | | sReturn = sErr + "," + e.Message; |
| | | oCn.RollBack(); |
| | | throw (e); |
| | | } |
| | |
| | | { |
| | | //æ¥è¯¢ä¸»è¡¨ |
| | | DataSet Ds; |
| | | Ds = oCn.RunProcReturn("Select * from Sc_ProcessExchangeBillMain Where HInterID=" + lngBillKey.ToString(), "Sc_ProcessExchangeBillMain"); |
| | | Ds = oCn.RunProcReturn("Select * from Sc_ProcessExchangeBillMain Where HInterID=" + lngBillKey.ToString()+" and HPRDORGID=" + DBUtility.ClsPub.HOrgID + " ", "Sc_ProcessExchangeBillMain"); |
| | | if (Ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | sReturn = "åæ®æªæ¾å°ï¼"; |