| | |
| | | try |
| | | { |
| | | //å¾å°mainid |
| | | omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | oCn.BeginTran(); |
| | | |
| | | string sql = ""; |
| | | |
| | | sql = "Insert Into OA_ErrMsgBackBillMain" + |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HYear,HPeriod,HRemark,HMaker,HMakeDate,HContext,HDeptID,HDescription,HSendMan,HReceiveMan,HCopyMan,HHasten,HLevel,HReTransmitMan,HBillTypeName" + |
| | | ",HPlanBillNo,HMaterName,HMaterModel,HQty,HSendType) " + |
| | | " values(" + |
| | | "'" + this.BillType + |
| | | "','" + this.HBillSubType + |
| | | "'," + omodel.HInterID.ToString() + |
| | | ",'" + omodel.HBillNo + |
| | | "','" + omodel.HDate + |
| | | "'," + omodel.HYear + |
| | | "," + omodel.HPeriod + |
| | | ",'" + omodel.HRemark + |
| | | "','" + omodel.HSendMan + |
| | | "',getdate()" + |
| | | ",'" + omodel.HContext + |
| | | "'," + omodel.HDeptID.ToString() + |
| | | ",'" + omodel.HDescription + |
| | | "','" + omodel.HSendMan + |
| | | "','" + omodel.HReceiveMan + |
| | | "','" + omodel.HCopyMan + |
| | | "'," + omodel.HHasten.ToString() + |
| | | ",'" + omodel.HLevel + |
| | | "','" + omodel.HReTransmitMan + |
| | | "','" + omodel.HBillTypeName + |
| | | "','" + omodel.HPlanBillNo + |
| | | "','" + omodel.HMaterName + |
| | | "','" + omodel.HMaterModel + |
| | | "'," + omodel.HQty.ToString() + |
| | | ",'" + omodel.HSendType + |
| | | "') "; |
| | | //主表 |
| | | oCn.RunProc("Insert Into OA_ErrMsgBackBillMain " + |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + |
| | | ",HYear,HPeriod,HRemark,HMaker,HMakeDate" + |
| | | ",HContext,HDeptID,HDescription,HSendMan,HReceiveMan" + |
| | | ",HCopyMan,HHasten,HLevel,HReTransmitMan,HBillTypeName"+ |
| | | ",HPlanBillNo,HMaterName,HMaterModel,HQty,HSendType"+ |
| | | ") " + |
| | | " values('" + this.BillType + "','" + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" + |
| | | "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" + |
| | | ",'" + omodel.HContext + "'," + omodel.HDeptID.ToString() + ",'" + omodel.HDescription + "','" + omodel.HSendMan + "','" + omodel.HReceiveMan + "'" + |
| | | ",'" + omodel.HCopyMan + "'," + omodel.HHasten.ToString() + ",'" + omodel.HLevel + "','" + omodel.HReTransmitMan + "','" + omodel.HBillTypeName + "'" + |
| | | ",'" + omodel.HPlanBillNo + "','" + omodel.HMaterName + "','" + omodel.HMaterModel + "'," + omodel.HQty.ToString() + ",'" + omodel.HSendType + "'" + |
| | | ") "); |
| | | //æå
¥å表 |
| | | oCn.RunProc(sql); |
| | | |
| | | //æå
¥å表1 |
| | | foreach (Model.ClsOA_ErrMsgBackBillSub oSub in DetailColl) |
| | | { |
| | | oCn.RunProc("Insert into OA_ErrMsgBackBillSub " + |
| | | " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + |
| | | ",HSendStatus,HSendMan,HDescription,HDate" + |
| | | ") values(" |
| | | + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + 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.HSendStatus.ToString() + ",'" + oSub.HSendMan + "','" + oSub.HDescription + "','" + oSub.HDate.ToShortDateString() + "'" + |
| | | ") "); |
| | | |
| | | sql = "Insert into OA_ErrMsgBackBillSub" + |
| | | "(HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + |
| | | ",HSendStatus,HSendMan,HDescription,HDate)" + |
| | | " values(" + |
| | | "" + omodel.HInterID.ToString() + |
| | | "," + oSub.HEntryID.ToString() + |
| | | ",'" + oSub.HCloseMan + |
| | | "','" + oSub.HEntryCloseDate.ToShortDateString() + |
| | | "'," + 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.HSendStatus.ToString() + |
| | | ",'" + oSub.HSendMan + |
| | | "','" + oSub.HDescription + |
| | | "','" + oSub.HDate.ToShortDateString() + |
| | | "') "; |
| | | oCn.RunProc(sql); |
| | | } |
| | | // |
| | | |
| | | //æå
¥å表2 |
| | | foreach (Model.ClsOA_ErrMsgBackBillSub2 oSubSec in DetailColl2) |
| | | { |
| | | oCn.RunProc("Insert into OA_ErrMsgBackBillSub2 " + |
| | | " (HInterID,HEntryID" + |
| | | ",HReceiveMan,HReadFlag" + |
| | | ")" + |
| | | " values(" |
| | | + omodel.HInterID.ToString() + "," + oSubSec.HEntryID.ToString() + |
| | | ",'" + oSubSec.HReceiveMan + "'," + Convert.ToString(oSubSec.HReadFlag ? 1 : 0) + |
| | | ") "); |
| | | sql = "Insert into OA_ErrMsgBackBillSub2" + |
| | | "(HInterID,HEntryID,HReceiveMan,HReadFlag)" + |
| | | " values(" + |
| | | "" + omodel.HInterID.ToString() + |
| | | "," + oSubSec.HEntryID.ToString() + |
| | | ",'" + oSubSec.HReceiveMan + |
| | | "'," + Convert.ToString(oSubSec.HReadFlag ? 1 : 0) + |
| | | ") "; |
| | | |
| | | |
| | | oCn.RunProc(sql); |
| | | } |
| | | //foreach (Model.ClsOA_ErrMsgBackBillSub oSub in DetailColl) |
| | | //{ |