From dbbcd506929afda0a85ae23bcb5f88c1dccef387 Mon Sep 17 00:00:00 2001
From: pzy <2829717936@qq.com>
Date: 星期一, 26 八月 2024 15:19:55 +0800
Subject: [PATCH] 11

---
 DAL/销售管理/ClsXs_CusRatingChangeBill.cs |   62 ++++++++++++++++++++++---------
 1 files changed, 44 insertions(+), 18 deletions(-)

diff --git "a/DAL/\351\224\200\345\224\256\347\256\241\347\220\206/ClsXs_CusRatingChangeBill.cs" "b/DAL/\351\224\200\345\224\256\347\256\241\347\220\206/ClsXs_CusRatingChangeBill.cs"
index e3c7e6d..017b171 100644
--- "a/DAL/\351\224\200\345\224\256\347\256\241\347\220\206/ClsXs_CusRatingChangeBill.cs"
+++ "b/DAL/\351\224\200\345\224\256\347\256\241\347\220\206/ClsXs_CusRatingChangeBill.cs"
@@ -37,7 +37,7 @@
                 //
                 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() +
@@ -46,13 +46,22 @@
                 ",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);
                 ////鍒犻櫎瀛愯〃
@@ -86,33 +95,42 @@
             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);
                 //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
-                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);
+                //}
+                //
+
+                //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+                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)
                 //{
@@ -161,6 +179,14 @@
                 //
                 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();

--
Gitblit v1.9.1