yusijie
2022-12-22 7f3034113076f4a599ac2c6e1d14b7ddd0f57788
DAL/Éú²ú¹ÜÀí/Ä£¾ß¹ÜÀí/ClsSc_MouldMaintainPlanBill.cs
@@ -9,6 +9,7 @@
    {
        public Model.ClsSc_MouldMaintainPlanBillMain omodel = new Model.ClsSc_MouldMaintainPlanBillMain();
        public List<Model.ClsSc_MouldMaintainPlanBillSub> DetailColl = new List<Model.ClsSc_MouldMaintainPlanBillSub>();
        public List<Model.ClsSc_MouldMaintainPlanBillSub_Item> DetailCol = new List<Model.ClsSc_MouldMaintainPlanBillSub_Item>();
        public ClsSc_MouldMaintainPlanBill()
        {
@@ -56,7 +57,7 @@
                //",HGroupID=" + omodel.HGroupID.ToString() +
                //",HWHID=" + omodel.HWHID.ToString() +
                //",HSCWHID=" + omodel.HSCWHID.ToString() +
                 ",HEquipDotCheckRuleInterID='" + omodel.HEquipDotCheckRuleInterID + "'" +
                ",HCycleUnit='" + omodel.HCycleUnit + "'" +
                ",HCheckCycle=" + omodel.HCheckCycle.ToString() +
                ",HBeginDate='" + omodel.HBeginDate + "'" +
@@ -69,8 +70,10 @@
                DeleteRelation(ref sReturn, lngBillKey);
                //删除子表
                DeleteBillSub(lngBillKey);
                //插入子表
                oCn.RunProc("delete from Sc_MouldMaintainPlanBillSub_Item where HInterID=" + lngBillKey);
                omodel.HInterID = lngBillKey;
                //插入子表配件信息
                foreach (Model.ClsSc_MouldMaintainPlanBillSub oSub in DetailColl)
                {
                    oCn.RunProc("Insert into Sc_MouldMaintainPlanBillSub " +
@@ -84,6 +87,24 @@
                     ",'" + oSub.HCloseMan + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
                     "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
                     ") ");
                }
                //插入保养项子表
                foreach (Model.ClsSc_MouldMaintainPlanBillSub_Item Item in DetailCol)
                {
                    oCn.RunProc("Insert into Sc_MouldMaintainPlanBillSub_Item" +
                          " (HInterID,HEntryID,HMaintainItemID" +
                          ",HMaintainPart,HClaim" +
                          ",HManagerID" +
                          ",HCloseMan,HCloseType,HRemark" +
                          ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney,HMaintainItem" +
                          ") values("
                          + omodel.HInterID.ToString() + "," + Item.HEntryID.ToString() + "," + Item.HMaintainItemID.ToString() +
                          ",'" + Item.HMaintainPart.ToString() + "','" + Item.HClaim.ToString() + "'" +
                          "," + Item.HManagerID.ToString() +
                          ",'" + Item.HCloseMan + "'," + Convert.ToString(Item.HCloseType ? 1 : 0) + ",'" + Item.HRemark + "'" +
                          "," + Item.HSourceInterID.ToString() + "," + Item.HSourceEntryID.ToString() + ",'" + Item.HSourceBillNo + "','" + Item.HSourceBillType + "'," + Item.HRelationQty.ToString() + "," + Item.HRelationMoney.ToString() + "," + Item.HMaintainItem.ToString() +
                          ") ");
                }
                //
                //foreach (Model.ClsSc_MouldMaintainPlanBillSub oSub in DetailColl)
@@ -122,14 +143,14 @@
                "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate" + 
                ",HYear,HPeriod,HRemark" +
                ",HCycleUnit,HCheckCycle,HBeginDate,HEndDate"+
                ",HInnerBillNo,HExplanation" +
                ",HInnerBillNo,HExplanation,HEquipDotCheckRuleInterID" +
                ") " +
                " values('" + this.BillType + "','"  + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" +
                "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'"+
                ",'" + omodel.HCycleUnit + "'," + omodel.HCheckCycle.ToString() + ",'" + omodel.HBeginDate + "','" + omodel.HEndDate + "'" +
                ",'" + omodel.HInnerBillNo + "','" + omodel.HExplanation + "'" +
                ",'" + omodel.HInnerBillNo + "','" + omodel.HExplanation + "'" + "','" + omodel.HEquipDotCheckRuleInterID + "'" +
                ") ");
                //插入子表
                //插入子表配件信息
                foreach (Model.ClsSc_MouldMaintainPlanBillSub oSub in DetailColl)
                {
                    oCn.RunProc("Insert into Sc_MouldMaintainPlanBillSub " +
@@ -144,6 +165,24 @@
                      "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
                      ") ");
                }
                //插入保养项子表
                foreach (Model.ClsSc_MouldMaintainPlanBillSub_Item Item in DetailCol)
                {
                    oCn.RunProc("Insert into Sc_MouldMaintainPlanBillSub_Item" +
                          " (HInterID,HEntryID,HMaintainItemID" +
                          ",HMaintainPart,HClaim" +
                          ",HManagerID" +
                          ",HCloseMan,HCloseType,HRemark" +
                          ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney,HMaintainItem" +
                          ") values("
                          + omodel.HInterID.ToString() + "," + Item.HEntryID.ToString() + "," + Item.HMaintainItemID.ToString() +
                          ",'" + Item.HMaintainPart.ToString() + "','" + Item.HClaim.ToString() + "'" +
                          "," + Item.HManagerID.ToString() +
                          ",'" + Item.HCloseMan + "'," + Convert.ToString(Item.HCloseType ? 1 : 0) + ",'" + Item.HRemark + "'" +
                          "," + Item.HSourceInterID.ToString() + "," + Item.HSourceEntryID.ToString() + ",'" + Item.HSourceBillNo + "','" + Item.HSourceBillType + "'," + Item.HRelationQty.ToString() + "," + Item.HRelationMoney.ToString()  +"," + Item.HMaintainItem.ToString() +
                          ") ");
                }
                //
                //foreach (Model.ClsSc_MouldMaintainPlanBillSub oSub in DetailColl)
                //{