From 4ae0d2f3444476e5791cb3d08cff2aa5ffe885b9 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期一, 10 七月 2023 16:35:35 +0800
Subject: [PATCH] 1
---
DAL/生产管理/设备管理/ClsSb_EquipMaintainPlanBill.cs | 114 ++++++++++++++++++++++++++++++++-------------------------
1 files changed, 64 insertions(+), 50 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..b4c6d51 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";
@@ -41,17 +41,17 @@
//鏇存柊涓昏〃
oCn.RunProc("UpDate Sb_EquipMaintainPlanBillMain set " +
" HBillNo='" + omodel.HBillNo + "'" + //鍥哄畾璧嬪��===============
- ",HDate='" + omodel.HDate + "'" +
",HYear='" + omodel.HYear.ToString() + "'" +
",HPeriod='" + omodel.HPeriod.ToString() + "'" +
",HRemark='" + omodel.HRemark + "'" +
- ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" +
+ ",HUpDater='" + omodel.HMaker + "'" +
",HUpDateDate=getdate()" +
//========================================
",HEquipID=" + omodel.HEquipID.ToString() +
",HBeginDate='" + omodel.HBeginDate + "'" +
",HEndDate='" + omodel.HEndDate+"'" +
",HCycleUnit='" + omodel.HCycleUnit + "'" +
+ ",HMouldMaintainRuleID='" + omodel.HMouldMaintainRuleID + "'" +
",HCheckCycle=" + omodel.HCheckCycle.ToString() +
",HExplanation='" + omodel.HExplanation+"'" +
",HInnerBillNo='" + omodel.HInnerBillNo+"'" +
@@ -60,36 +60,43 @@
DeleteRelation(ref sReturn, lngBillKey);
//鍒犻櫎瀛愯〃
DeleteBillSub(lngBillKey);
+ DeleteBillSub2(lngBillKey);
//鎻掑叆瀛愯〃
omodel.HInterID = lngBillKey;
+ //鎻掑叆閰嶄欢椤瑰瓙琛�
foreach (Model.ClsSb_EquipMaintainPlanBillSub oSub in DetailColl)
{
oCn.RunProc("Insert into Sb_EquipMaintainPlanBillSub " +
" (HInterID,HEntryID," +
"HCloseMan,HEntryCloseDate,HCloseType,HRemark," +
"HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney," +
- "HQty,HMaterID,HMaterNumber,HUnitID,HUnitNumber,HQtyMust" +
- //"HManagerID,HManagerNumber" +
+ "HQty,HMaterID,HMaterNumber,HUnitID,HUnitNumber,HQtyMust," +
+ "HManagerID" +
") values("
+ omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() +
",'" + oSub.HCloseMan + "','"+oSub.HEntryCloseDate+"'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
"," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
"," + oSub.HQty.ToString() + "," + oSub.HMaterID.ToString() + ",'" + oSub.HMaterNumber + "'," + oSub.HUnitID.ToString() + ",'" + oSub.HUnitNumber + "'," + oSub.HQtyMust.ToString() +
- //"," + oSub.HManagerID.ToString()+",'" +oSub.HManagerNumber+"'"+
+ "," + oSub.HManagerID.ToString() +
") ");
}
- //
- //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;
@@ -114,42 +121,49 @@
oCn.RunProc("Insert Into Sb_EquipMaintainPlanBillMain " +
"(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate" +
",HYear,HPeriod,HRemark,HEquipID" +
- ",HBeginDate,HEndDate,HCheckCycle,HCycleUnit,HExplanation,HInnerBillNo" +
+ ",HBeginDate,HEndDate,HCheckCycle,HCycleUnit,HExplanation,HInnerBillNo,HMouldMaintainRuleID" +
") "+
- " values('" + this.BillType + "','" + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" +
+ " values('" + this.BillType + "','" + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker + "',getdate()" +
"," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'," + omodel.HEquipID.ToString() +
- ",'" + omodel.HBeginDate +"','" +omodel.HEndDate + "'," + omodel.HCheckCycle.ToString() +",'"+ omodel.HCycleUnit + "','" + omodel.HExplanation + "','" + omodel.HInnerBillNo +"'" +
+ ",'" + omodel.HBeginDate +"','" +omodel.HEndDate + "'," + omodel.HCheckCycle.ToString() +",'"+ omodel.HCycleUnit + "','" + omodel.HExplanation + "','" + omodel.HInnerBillNo +"','" + omodel.HMouldMaintainRuleID + "'" +
") ");
- //鎻掑叆瀛愯〃
- foreach (Model.ClsSb_EquipMaintainPlanBillSub oSub in DetailColl)
+ if (DetailColl != null)
{
- oCn.RunProc("Insert into Sb_EquipMaintainPlanBillSub " +
- " (HInterID,HEntryID," +
- "HCloseMan,HEntryCloseDate,HCloseType,HRemark," +
- "HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney," +
- "HQty,HMaterID,HMaterNumber,HUnitID,HUnitNumber,HQtyMust" +
- //"HManagerID,HManagerNumber" +
- ") values("
- + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() +
- ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
- "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
- "," + oSub.HQty.ToString() + "," + oSub.HMaterID.ToString() + ",'" + oSub.HMaterNumber + "'," + oSub.HUnitID.ToString() + ",'" + oSub.HUnitNumber + "'," + oSub.HQtyMust.ToString() +
- //"," + oSub.HManagerID.ToString()+",'" +oSub.HManagerNumber+"'"+
- ") ");
+ //鎻掑叆閰嶄欢瀛愯〃
+ foreach (Model.ClsSb_EquipMaintainPlanBillSub oSub in DetailColl)
+ {
+ oCn.RunProc("Insert into Sb_EquipMaintainPlanBillSub " +
+ " (HInterID,HEntryID," +
+ "HCloseMan,HEntryCloseDate,HCloseType,HRemark," +
+ "HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney," +
+ "HQty,HMaterID,HMaterNumber,HUnitID,HUnitNumber,HQtyMust," +
+ "HManagerID" +
+ ") values("
+ + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() +
+ ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
+ "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
+ "," + oSub.HQty.ToString() + "," + oSub.HMaterID.ToString() + ",'" + oSub.HMaterNumber + "'," + oSub.HUnitID.ToString() + ",'" + oSub.HUnitNumber + "'," + oSub.HQtyMust.ToString() +
+ "," + oSub.HManagerID.ToString() +
+ ") ");
+ }
}
- //
- //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