From 5f53f2b4cff3c09365d23a7ee28732aafc0a0a1a Mon Sep 17 00:00:00 2001 From: 沈泽 <211959439@qq.com> Date: 星期二, 14 九月 2021 08:21:21 +0800 Subject: [PATCH] 1 --- DAL/生产管理/设备管理/ClsSb_EquipMaintainBill.cs | 69 +++++++++++++++++++--------------- 1 files changed, 39 insertions(+), 30 deletions(-) diff --git "a/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipMaintainBill.cs" "b/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipMaintainBill.cs" index 786b1d9..ac58894 100644 --- "a/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipMaintainBill.cs" +++ "b/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipMaintainBill.cs" @@ -9,18 +9,17 @@ { public Model.ClsSb_EquipMaintainBillMain omodel = new Model.ClsSb_EquipMaintainBillMain(); public List<Model.ClsSb_EquipMaintainBillSub> DetailColl = new List<Model.ClsSb_EquipMaintainBillSub>(); - + public List<Model.ClsSc_EquipMaintainBillSub_Item> DetailCol = new List<Model.ClsSc_EquipMaintainBillSub_Item>(); public ClsSb_EquipMaintainBill() { base.MvarItemKeySub = "Sb_EquipMaintainBillSub"; - base.MvarItemKeySub2 = ""; + base.MvarItemKeySub2 = "Sb_EquipMaintainBillSub_Item"; base.MvarItemKeySub3 = ""; base.MvarItemKeySub4 = ""; base.MvarItemKey="Sb_EquipMaintainBillMain"; base.MvarReportTitle="璁惧淇濆吇璁板綍"; base.BillType = "3901"; base.HBillSubType = "3901"; - } #region 鍥哄畾浠g爜 @@ -59,7 +58,8 @@ DeleteRelation(ref sReturn, lngBillKey); //鍒犻櫎瀛愯〃 DeleteBillSub(lngBillKey); - //鎻掑叆瀛愯〃 + DeleteBillSub2(lngBillKey); + //鎻掑叆閰嶄欢椤瑰瓙琛� omodel.HInterID = lngBillKey; foreach (Model.ClsSb_EquipMaintainBillSub oSub in DetailColl) { @@ -77,18 +77,23 @@ "," + oSub.HManagerID.ToString()+",'" +oSub.HManagerNumber+"'"+ ") "); } - // - //foreach (Model.ClsSb_EquipMaintainBillSub oSub in DetailColl) - //{ - // Ds = oCn.RunProcReturn("exec h_p_Sb_EquipMaintainBill_Qty " + oSub.HICMOInterID, ""); - // if (Ds.Tables[0].Rows.Count == 0) - // return; - // if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y") - // { - // sReturn = "姹囨姤鏁伴噺瓒呰繃璁″垝鏁伴噺锛佷笉鍏佽淇濆瓨"; - // return false; - // } - //} + //鎻掑叆淇濆吇椤瑰瓙琛� + foreach (Model.ClsSc_EquipMaintainBillSub_Item Item in DetailCol) + { + oCn.RunProc("Insert into Sb_EquipMaintainBillSub_Item" + + " (HInterID,HEntryID,HMaintainItemID" + + ",HMaintainPart,HClaim" + + ",HManagerID" + + ",HCloseMan,HCloseType,HRemark" + + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + ") 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() + + ") "); + } sReturn = "淇敼鍗曟嵁鎴愬姛锛�"; oCn.Commit(); return true; @@ -119,7 +124,7 @@ "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'," + omodel.HEquipID.ToString() + ",'" + omodel.HBeginDate + "','" + omodel.HEndDate + "','" + omodel.HPlanNo + "','" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'" + ") "); - //鎻掑叆瀛愯〃 + //鎻掑叆閰嶄欢瀛愯〃 foreach (Model.ClsSb_EquipMaintainBillSub oSub in DetailColl) { oCn.RunProc("Insert into Sb_EquipMaintainBillSub " + @@ -136,19 +141,23 @@ "," + oSub.HManagerID.ToString() + ",'" + oSub.HManagerNumber + "'" + ") "); } - // - //foreach (Model.ClsSb_EquipMaintainBillSub oSub in DetailColl) - //{ - // Ds = oCn.RunProcReturn("exec h_p_Sb_EquipMaintainBill_Qty " + oSub.HICMOInterID, ""); - // if (Ds.Tables[0].Rows.Count == 0) - // return; - // if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y") - // { - // sReturn = "姹囨姤鏁伴噺瓒呰繃璁″垝鏁伴噺锛佷笉鍏佽淇濆瓨"; - // return false; - // } - //} - // + //鎻掑叆淇濆吇椤瑰瓙琛� + foreach (Model.ClsSc_EquipMaintainBillSub_Item Item in DetailCol) + { + oCn.RunProc("Insert into Sb_EquipMaintainBillSub_Item" + + " (HInterID,HEntryID,HMaintainItemID" + + ",HMaintainPart,HClaim" + + ",HManagerID" + + ",HCloseMan,HCloseType,HRemark" + + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + ") 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() + + ") "); + } sReturn = "鏂板鍗曟嵁鎴愬姛锛�"; oCn.Commit(); return true; -- Gitblit v1.9.1