From b53e9c3339aca50d592080cf857390678f414099 Mon Sep 17 00:00:00 2001 From: zzr99 <1940172413@qq.com> Date: 星期二, 07 九月 2021 17:38:09 +0800 Subject: [PATCH] 设备保养计划列表和编辑做成双网格 --- DAL/生产管理/设备管理/ClsSb_EquipMaintainPlanBill.cs | 67 +++++++++++++++++++-------------- 1 files changed, 39 insertions(+), 28 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_EquipMaintainPlanBill.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_EquipMaintainPlanBill.cs" index 5cb1e6e..9ad9ae9 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_EquipMaintainPlanBill.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_EquipMaintainPlanBill.cs" @@ -9,11 +9,11 @@ { public Model.ClsSb_EquipMaintainPlanBillMain omodel = new Model.ClsSb_EquipMaintainPlanBillMain(); public List<Model.ClsSb_EquipMaintainPlanBillSub> DetailColl = new List<Model.ClsSb_EquipMaintainPlanBillSub>(); - + public List<Model.ClsSc_EquipMaintainPlanBillSub_Item> DetailCol = new List<Model.ClsSc_EquipMaintainPlanBillSub_Item>(); public ClsSb_EquipMaintainPlanBill() { base.MvarItemKeySub = "Sb_EquipMaintainPlanBillSub"; - base.MvarItemKeySub2 = ""; + base.MvarItemKeySub2 = "Sb_EquipMaintainPlanBillSub_Item"; base.MvarItemKeySub3 = ""; base.MvarItemKeySub4 = ""; base.MvarItemKey="Sb_EquipMaintainPlanBillMain"; @@ -60,8 +60,10 @@ DeleteRelation(ref sReturn, lngBillKey); //鍒犻櫎瀛愯〃 DeleteBillSub(lngBillKey); + DeleteBillSub2(lngBillKey); //鎻掑叆瀛愯〃 omodel.HInterID = lngBillKey; + //鎻掑叆閰嶄欢椤瑰瓙琛� foreach (Model.ClsSb_EquipMaintainPlanBillSub oSub in DetailColl) { oCn.RunProc("Insert into Sb_EquipMaintainPlanBillSub " + @@ -78,18 +80,23 @@ //"," + oSub.HManagerID.ToString()+",'" +oSub.HManagerNumber+"'"+ ") "); } - // - //foreach (Model.ClsSb_EquipMaintainPlanBillSub oSub in DetailColl) - //{ - // Ds = oCn.RunProcReturn("exec h_p_Sb_EquipMaintainPlanBill_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_EquipMaintainPlanBillSub_Item Item in DetailCol) + { + oCn.RunProc("Insert into Sb_EquipMaintainPlanBillSub_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() + + ") "); + } sReturn = "淇敼鍗曟嵁鎴愬姛锛�"; oCn.Commit(); return true; @@ -120,7 +127,7 @@ "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'," + omodel.HEquipID.ToString() + ",'" + omodel.HBeginDate +"','" +omodel.HEndDate + "'," + omodel.HCheckCycle.ToString() +",'"+ omodel.HCycleUnit + "','" + omodel.HExplanation + "','" + omodel.HInnerBillNo +"'" + ") "); - //鎻掑叆瀛愯〃 + //鎻掑叆閰嶄欢瀛愯〃 foreach (Model.ClsSb_EquipMaintainPlanBillSub oSub in DetailColl) { oCn.RunProc("Insert into Sb_EquipMaintainPlanBillSub " + @@ -137,19 +144,23 @@ //"," + oSub.HManagerID.ToString()+",'" +oSub.HManagerNumber+"'"+ ") "); } - // - //foreach (Model.ClsSb_EquipMaintainPlanBillSub oSub in DetailColl) - //{ - // Ds = oCn.RunProcReturn("exec h_p_Sb_EquipMaintainPlanBill_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_EquipMaintainPlanBillSub_Item Item in DetailCol) + { + oCn.RunProc("Insert into Sb_EquipMaintainPlanBillSub_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() + + ") "); + } sReturn = "鏂板鍗曟嵁鎴愬姛锛�"; oCn.Commit(); return true; -- Gitblit v1.9.1