| | |
| | | // |
| | | oCn.BeginTran(); |
| | | //æ´æ°ä¸»è¡¨ |
| | | oCn.RunProc("UpDate Xs_CusRatingChangeBillMain set " + |
| | | string mainSql = "UpDate Xs_CusRatingChangeBillMain set " + |
| | | " HBillNo='" + omodel.HBillNo + "'" + |
| | | ",HDeptID=" + omodel.HDeptID.ToString() + |
| | | ",HEmpID=" + omodel.HEmpID.ToString() + |
| | |
| | | ",HOldRating=" + omodel.HOldRating.ToString() + |
| | | ",HNewRating=" + omodel.HNewRating.ToString() + |
| | | ",HReason='" + omodel.HReason + "'" + |
| | | ",HManagerID=" + omodel.HManagerID + |
| | | ",HOrgID=" + omodel.HOrgID + |
| | | ",HRemark='" + omodel.HRemark + "'" + |
| | | ",HOldRatingDate=" + omodel.HOldRatingDate + |
| | | ",HNewRatingDate=" + omodel.HNewRatingDate + |
| | | ",HOldRedRatingDate=" + omodel.HOldRedRatingDate + |
| | | ",HNewRedRatingDate=" + omodel.HNewRedRatingDate + |
| | | ",HFinanceCheck='" + omodel.HFinanceCheck + "'" + |
| | | ",HFinanceCheckStatus='" + omodel.HFinanceCheckStatus + "'" + |
| | | ",HGeneralManager='" + omodel.HGeneralManager + "'" + |
| | | ",HGeneralManagerStatus='" + omodel.HGeneralManagerStatus + "'" + |
| | | ",HUpDater='" + omodel.HUpDater + "'" + |
| | | ",HUpDateDate='" + omodel.HUpDateDate + "'" + |
| | | " where HInterID=" + lngBillKey.ToString()); |
| | | " where HInterID=" + lngBillKey.ToString(); |
| | | |
| | | oCn.RunProc(mainSql); |
| | | //å é¤å
³è |
| | | DeleteRelation(ref sReturn, lngBillKey); |
| | | ////å é¤å表 |
| | |
| | | try |
| | | { |
| | | //å¾å°mainid |
| | | omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | omodel.HBillNo = DBUtility.ClsPub.CreateBillCode(BillType, ref DBUtility.ClsPub.sExeReturnInfo, true); |
| | | //omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //omodel.HBillNo = DBUtility.ClsPub.CreateBillCode(BillType, ref DBUtility.ClsPub.sExeReturnInfo, true); |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | if (IsExistBillNo(ref DBUtility.ClsPub.sExeReturnInfo, omodel.HBillNo, Pub_Class.ClsPub.Enum_BillStatus.BillStatus_AddNew, omodel.HInterID)) |
| | | { |
| | | omodel.HBillNo = DBUtility.ClsPub.CreateBillCode(BillType, ref DBUtility.ClsPub.sExeReturnInfo, true); |
| | | } |
| | | if (IsExistMainID(ref DBUtility.ClsPub.sExeReturnInfo, omodel.HInterID, Pub_Class.ClsPub.Enum_BillStatus.BillStatus_AddNew)) |
| | | //if (IsExistBillNo(ref DBUtility.ClsPub.sExeReturnInfo, omodel.HBillNo, Pub_Class.ClsPub.Enum_BillStatus.BillStatus_AddNew, omodel.HInterID)) |
| | | //{ |
| | | // omodel.HBillNo = DBUtility.ClsPub.CreateBillCode(BillType, ref DBUtility.ClsPub.sExeReturnInfo, true); |
| | | //} |
| | | //if (IsExistMainID(ref DBUtility.ClsPub.sExeReturnInfo, omodel.HInterID, Pub_Class.ClsPub.Enum_BillStatus.BillStatus_AddNew)) |
| | | //{ |
| | | // omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //} |
| | | // |
| | | |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | while (IsExistMainID(ref DBUtility.ClsPub.sExeReturnInfo, omodel.HInterID, Pub_Class.ClsPub.Enum_BillStatus.BillStatus_AddNew)) |
| | | { |
| | | omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | // |
| | | |
| | | |
| | | oCn.BeginTran(); |
| | | //主表 |
| | | oCn.RunProc("Insert Into Xs_CusRatingChangeBillMain " + |
| | | "(HBillType,HInterID,HBillNo,HDate" + |
| | | ",HYear,HPeriod,HMaker,HMakeDate" + |
| | | ",HEmpID,HDeptID,HCusID" + |
| | | ",HReason,HFinanceCheck,HFinanceCheckStatus,HGeneralManager,HGeneralManagerStatus" + |
| | | ",HOldRating,HNewRating" + |
| | | string mainSql = "Insert Into Xs_CusRatingChangeBillMain " + |
| | | "(HBillType,HInterID,HBillNo,HDate,HYear,HPeriod,HMaker,HMakeDate" + |
| | | ",HEmpID,HDeptID,HCusID,HReason,HFinanceCheck,HFinanceCheckStatus,HGeneralManager,HGeneralManagerStatus" + |
| | | ",HOldRating,HNewRating,HManagerID,HOldRatingDate,HNewRatingDate,HOldRedRatingDate,HNewRedRatingDate,HOrgID,HRemark" + |
| | | ") " + |
| | | " values('" + this.BillType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate.ToShortDateString() + "'" + |
| | | "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + DBUtility.ClsPub.CurUserName + "',getdate()" + |
| | | "," + omodel.HEmpID.ToString() + "," + omodel.HDeptID.ToString() + "," + omodel.HCusID.ToString() + |
| | | ",'" + omodel.HReason + "','" + omodel.HFinanceCheck + "','" + omodel.HFinanceCheckStatus + "','" + omodel.HGeneralManager + "','" + omodel.HGeneralManagerStatus + "'" + |
| | | "," + omodel.HOldRating.ToString() + "," + omodel.HNewRating.ToString() + |
| | | ") "); |
| | | "," + omodel.HOldRating.ToString() + "," + omodel.HNewRating.ToString() + |
| | | "," + omodel.HManagerID + "," + omodel.HOldRatingDate + "," + omodel.HNewRatingDate + "," + omodel.HOldRedRatingDate + "," + omodel.HNewRedRatingDate + "," + omodel.HOrgID + ",'" + omodel.HRemark + "'" + |
| | | ") "; |
| | | |
| | | oCn.RunProc(mainSql); |
| | | ////æå
¥å表 |
| | | //foreach (Model.ClsXs_CusRatingChangeBillSub oSub in DetailColl) |
| | | //{ |
| | |
| | | // |
| | | omodel.HOldRating = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HOldRating"]); |
| | | omodel.HNewRating = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HNewRating"]); |
| | | |
| | | omodel.HManagerID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HManagerID"]); |
| | | omodel.HOrgID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HOrgID"]); |
| | | omodel.HRemark = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); |
| | | omodel.HOldRatingDate = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HOldRatingDate"]); |
| | | omodel.HNewRatingDate = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HNewRatingDate"]); |
| | | omodel.HOldRedRatingDate = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HOldRedRatingDate"]); |
| | | omodel.HNewRedRatingDate = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HNewRedRatingDate"]); |
| | | // |
| | | omodel.HReason = Ds.Tables[0].Rows[0]["HReason"].ToString().Trim(); |
| | | omodel.HFinanceCheck = Ds.Tables[0].Rows[0]["HFinanceCheck"].ToString().Trim(); |