yangle
2022-10-29 16bb2f7b48cf2c3cfbb6a026c265d4e52d22eca4
DAL/Éú²ú¹ÜÀí/Ä£¾ß¹ÜÀí/ClsSc_MouldMaintainBill.cs
@@ -8,12 +8,13 @@
    public  class ClsSc_MouldMaintainBill:DBUtility.ClsXt_BaseBill
    {
        public Model.ClsSc_MouldMaintainBillMain omodel = new Model.ClsSc_MouldMaintainBillMain();
        public List<Model.ClsSc_MouldMaintainRuleBillSub_Item> DetailCol = new List<Model.ClsSc_MouldMaintainRuleBillSub_Item>();
        public List<Model.ClsSc_MouldMaintainBillSub> DetailColl = new List<Model.ClsSc_MouldMaintainBillSub>();
        public ClsSc_MouldMaintainBill()
        {
            base.MvarItemKeySub = "Sc_MouldMaintainBillSub";
            base.MvarItemKeySub2 = "";
            base.MvarItemKeySub = "Sc_MouldMaintainBillSub_Item";
            base.MvarItemKeySub2 = "Sc_MouldMaintainBillSub";
            base.MvarItemKeySub3 = "";
            base.MvarItemKeySub4 = "";
            base.MvarItemKey="Sc_MouldMaintainBillMain";
@@ -56,7 +57,7 @@
                ",HEndDate='" + omodel.HEndDate + "'" +
                ",HExplanation='" + omodel.HExplanation + "'" +
                ",HInnerBillNo='" + omodel.HInnerBillNo + "'" +
                ",HMouldMaintainRuleInterID="+omodel.HMouldMaintainRuleInterID.ToString()+
                //",HDeptID=" + omodel.HDeptID.ToString() +
                //",HDeptNumber='" + omodel.HDeptNumber +"'"+
                //",HEmpID=" + omodel.HEmpID.ToString() +
@@ -70,10 +71,29 @@
                DeleteRelation(ref sReturn, lngBillKey);
                //删除子表
                DeleteBillSub(lngBillKey);
                //插入子表
                DeleteBillSub2(lngBillKey);
                omodel.HInterID = lngBillKey;
                //插入保养项子表
                foreach (Model.ClsSc_MouldMaintainRuleBillSub_Item Item in DetailCol)
                {
                    oCn.RunProc("Insert into Sc_MouldMaintainBillSub_Item" +
                          " (HInterID,HEntryID,HMaintainItemID,HMaintainItem" +
                          ",HMaintainPart,HClaim" +
                          ",HManagerID" +
                          ",HCloseMan,HCloseType,HRemark" +
                          ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                          ") values("
                          + omodel.HInterID.ToString() + "," + Item.HEntryID.ToString() + "," + Item.HMaintainItemID.ToString() + ",'" + Item.HMaintainItem.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() +
                          ") ");
                }
                //插入配件项子表
                foreach (Model.ClsSc_MouldMaintainBillSub oSub in DetailColl)
                {
                    oCn.RunProc("Insert into Sc_MouldMaintainBillSub " +
                      " (HInterID,HEntryID,HMaterID" +
                      ",HQty,HUnitID" +
@@ -126,30 +146,54 @@
                ",HYear,HPeriod,HRemark" +
                ",HPlanNo,HPlanInterID,HMouldID,HBeginDate"+
                ",HEndDate"+
                ",HInnerBillNo,HExplanation" +
                ",HInnerBillNo,HExplanation,HMouldMaintainRuleInterID" +
                ") " +
                " 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.HPlanNo + "'," + omodel.HPlanInterID.ToString() + "," + omodel.HMouldID.ToString() + ",'" + omodel.HBeginDate + "'" +
                ",'" + omodel.HEndDate + "'"+
                ",'" + omodel.HInnerBillNo + "','" + omodel.HExplanation + "'" +
                ",'" + omodel.HInnerBillNo + "','" + omodel.HExplanation + "'," +omodel.HMouldMaintainRuleInterID.ToString()+
                ") ");
                //插入子表
                foreach (Model.ClsSc_MouldMaintainBillSub oSub in DetailColl)
                if (DetailCol.Count > 0)
                {
                    oCn.RunProc("Insert into Sc_MouldMaintainBillSub " +
                      " (HInterID,HEntryID,HMaterID" +
                      ",HQty,HUnitID" +
                      ",HQtyMust,HManagerID" +
                      ",HCloseMan,HCloseType,HRemark" +
                      ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                      ") values("
                      + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + "," + oSub.HMaterID.ToString() +
                      "," + oSub.HQty.ToString() + "," + oSub.HUnitID.ToString() +
                      "," + oSub.HQtyMust.ToString() + "," + oSub.HManagerID.ToString() +
                      ",'" + 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_MouldMaintainRuleBillSub_Item Item in DetailCol)
                    {
                        oCn.RunProc("Insert into Sc_MouldMaintainBillSub_Item" +
                          " (HInterID,HEntryID,HMaintainItemID,HMaintainItem" +
                          ",HMaintainPart,HClaim" +
                          ",HManagerID" +
                          ",HCloseMan,HCloseType,HRemark" +
                          ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                          ") values("
                          + omodel.HInterID.ToString() + "," + Item.HEntryID.ToString() + "," + Item.HMaintainItemID.ToString() + ",'" + Item.HMaintainItem.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() +
                          ") ");
                    }
                }
                if (DetailColl.Count > 0)
                {
                    //插入配件项子表
                    foreach (Model.ClsSc_MouldMaintainBillSub oSub in DetailColl)
                    {
                        oCn.RunProc("Insert into Sc_MouldMaintainBillSub " +
                          " (HInterID,HEntryID,HMaterID" +
                          ",HQty,HUnitID" +
                          ",HQtyMust,HManagerID" +
                          ",HCloseMan,HCloseType,HRemark" +
                          ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                          ") values("
                          + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + "," + oSub.HMaterID.ToString() +
                          "," + oSub.HQty.ToString() + "," + oSub.HUnitID.ToString() +
                          "," + oSub.HQtyMust.ToString() + "," + oSub.HManagerID.ToString() +
                          ",'" + 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_MouldMaintainBillSub oSub in DetailColl)