llj
2025-10-20 2b5aa0f7d432d8dcd1aac3cd9d45d5a04a17d2c7
DAL/²É¹º¹ÜÀí/ClsCg_POStockInChangeBill.cs
@@ -55,7 +55,8 @@
                oCn.BeginTran();
                //更新主表
                string mainSql = "update Cg_POStockInChangeBillMain set " +
                    "HDate = '" + omodel.HDate + "'" +
                    " HBillNo = '" + omodel.HBillNo + "'"+
                    ",HDate = '" + omodel.HDate + "'" +
                    ", HYear = " + omodel.HDate.Year +
                    ", HPeriod  = " + omodel.HDate.Month +
                    ", HExplanation = '" + omodel.HExplanation + "'" +
@@ -67,7 +68,7 @@
                    " where HInterID = " + omodel.HInterID;
                oCn.RunProc(mainSql);
                //删除关联
                //DeleteRelation(ref sReturn, lngBillKey);
                DeleteRelation(ref sReturn, lngBillKey);
                //删除子表
                DeleteBillSub(lngBillKey);
@@ -77,7 +78,7 @@
                {
                    string subSql = "insert into Cg_POStockInChangeBillSub " +
                        "(HInterID,HEntryID,HBillNo_bak,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                        ",HMaterID,HUnitID,HQty,HTaxPrice_Old,HTaxPrice_New,HMoney_New) " +
                        ",HMaterID,HUnitID,HQty,HTaxPrice_Old,HTaxPrice_New,HMoney_New,HTaxRate_Old,HTaxRate_New) " +
                        " values(" +
                        "" + omodel.HInterID.ToString() +
                        "," + oSub.HEntryID.ToString() +
@@ -95,11 +96,13 @@
                        "," + oSub.HTaxPrice_Old + "" +
                        "," + oSub.HTaxPrice_New + "" +
                        "," + oSub.HMoney_New + "" +
                        "," + oSub.HTaxRate_Old + "" +
                        "," + oSub.HTaxRate_New + "" +
                        ")";
                    oCn.RunProc(subSql);
                }
                //新增关联
                //AddNewRelation(ref sReturn, lngBillKey);
                AddNewRelation(ref sReturn, lngBillKey);
                //=========================保存后控制  
                DataSet ds2 = oCn.RunProcReturn("h_p_Cg_POStockInChangeBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Cg_POStockInChangeBill_AfterSaveCtrl");
@@ -184,7 +187,7 @@
                {
                    string subSql = "insert into Cg_POStockInChangeBillSub " +
                        "(HInterID,HEntryID,HBillNo_bak,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                        ",HMaterID,HUnitID,HQty,HTaxPrice_Old,HTaxPrice_New,HMoney_New) " +
                        ",HMaterID,HUnitID,HQty,HTaxPrice_Old,HTaxPrice_New,HMoney_New,HTaxRate_Old,HTaxRate_New) " +
                        " values(" +
                        "" + omodel.HInterID.ToString() +
                        "," + oSub.HEntryID.ToString() +
@@ -202,6 +205,8 @@
                        "," + oSub.HTaxPrice_Old + "" +
                        "," + oSub.HTaxPrice_New + "" +
                        "," + oSub.HMoney_New + "" +
                        "," + oSub.HTaxRate_Old + "" +
                        "," + oSub.HTaxRate_New + "" +
                        ")";
                    oCn.RunProc(subSql);
                }
@@ -315,6 +320,8 @@
                    oSub.HTaxPrice_Old = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HTaxPrice_Old"]);
                    oSub.HTaxPrice_New = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HTaxPrice_New"]);
                    oSub.HMoney_New = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HMoney_New"]);
                    oSub.HTaxRate_Old = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HTaxRate_Old"]);
                    oSub.HTaxRate_New = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HTaxRate_New"]);
                    DetailColl.Add(oSub);
                }