From 070a771bf9af8fac6c2ba7bf09efb3f8b3b04585 Mon Sep 17 00:00:00 2001
From: zzr99 <1940172413@qq.com>
Date: 星期一, 29 十一月 2021 18:39:05 +0800
Subject: [PATCH] 设备维修记录修复
---
WebAPI/DLL/ClsSb_EquipMaintainRuleBill.cs | 137 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 137 insertions(+), 0 deletions(-)
diff --git a/WebAPI/DLL/ClsSb_EquipMaintainRuleBill.cs b/WebAPI/DLL/ClsSb_EquipMaintainRuleBill.cs
index 9a2ee03..0007191 100644
--- a/WebAPI/DLL/ClsSb_EquipMaintainRuleBill.cs
+++ b/WebAPI/DLL/ClsSb_EquipMaintainRuleBill.cs
@@ -33,5 +33,142 @@
}
#endregion 鑷畾涔夋柟娉�
+
+ //淇敼鍗曟嵁
+ public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
+ {
+ try
+ {
+ //
+ oCn.BeginTran();
+ //鏇存柊涓昏〃
+ oCn.RunProc("UpDate Sb_EquipMaintainPlanBillMain set " +
+ " HBillNo='" + omodel.HBillNo + "'" + //鍥哄畾璧嬪��===============
+ ",HDate='" + omodel.HDate + "'" +
+ ",HYear='" + omodel.HYear.ToString() + "'" +
+ ",HPeriod='" + omodel.HPeriod.ToString() + "'" +
+ ",HRemark='" + omodel.HRemark + "'" +
+ ",HUpDater='" + omodel.HMaker + "'" +
+ ",HUpDateDate=getdate()" +
+ //========================================
+ ",HCycleUnit='" + omodel.HCycleUnit + "'" +
+ ",HCheckCycle=" + omodel.HCheckCycle.ToString() +
+ ",HExplanation='" + omodel.HExplanation + "'" +
+ ",HInnerBillNo='" + omodel.HInnerBillNo + "'" +
+ " where HInterID=" + lngBillKey.ToString());
+ //鍒犻櫎鍏宠仈
+ DeleteRelation(ref sReturn, lngBillKey);
+ //鍒犻櫎瀛愯〃
+ DeleteBillSub(lngBillKey);
+ DeleteBillSub2(lngBillKey);
+ //鎻掑叆瀛愯〃
+ omodel.HInterID = lngBillKey;
+ //鎻掑叆淇濆吇椤瑰瓙琛�
+ foreach (Models.ClsSb_EquipMaintainRuleBillSub_Item Item in DetailColl_Pay)
+ {
+ oCn.RunProc("Insert into Sb_EquipMaintainRuleBillSub_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 (Models.ClsSb_EquipMaintainRuleBillSub oSub in DetailColl_Mater)
+ {
+ oCn.RunProc("Insert into Sb_EquipMaintainRuleBillSub " +
+ " (HInterID,HEntryID," +
+ "HCloseMan,HEntryCloseDate,HCloseType,HRemark," +
+ "HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney," +
+ "HQty,HMaterID,HUnitID,HQtyMust" +
+ ") 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.HUnitID.ToString() + "," + oSub.HQtyMust.ToString() +
+ ") ");
+ }
+ sReturn = "淇敼鍗曟嵁鎴愬姛锛�";
+ oCn.Commit();
+ return true;
+ }
+ catch (Exception e)
+ {
+ sReturn = e.Message;
+ oCn.RollBack();
+ throw (e);
+ }
+ }
+ //鏂板鍗曟嵁
+ public override bool AddBill(ref string sReturn)
+ {
+ try
+ {
+ //寰楀埌mainid
+ omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
+ //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+ oCn.BeginTran();
+ //涓昏〃
+ oCn.RunProc("Insert Into Sb_EquipMaintainRuleBillMain " +
+ "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate" +
+ ",HYear,HPeriod,HRemark" +
+ ",HCheckCycle,HCycleUnit,HExplanation,HInnerBillNo" +
+ ") " +
+ " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker + "',getdate()" +
+ "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark +
+ "',"+ omodel.HCheckCycle.ToString() + ",'" + omodel.HCycleUnit + "','" + omodel.HExplanation + "','" + omodel.HInnerBillNo +
+ "') ");
+
+ //鎻掑叆淇濆吇椤瑰瓙琛�
+ foreach (Models.ClsSb_EquipMaintainRuleBillSub_Item Item in DetailColl_Pay)
+ {
+ oCn.RunProc("Insert into Sb_EquipMaintainRuleBillSub_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 (Models.ClsSb_EquipMaintainRuleBillSub oSub in DetailColl_Mater)
+ {
+ string sql = "Insert into Sb_EquipMaintainRuleBillSub " +
+ " (HInterID,HEntryID," +
+ "HCloseMan,HEntryCloseDate,HCloseType,HRemark," +
+ "HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney," +
+ "HQty,HMaterID,HUnitID,HQtyMust" +
+ ") 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.HUnitID.ToString() + ",0" +
+ ") ";
+ oCn.RunProc(sql);
+ }
+ sReturn = "鏂板鍗曟嵁鎴愬姛锛�";
+ oCn.Commit();
+ return true;
+ }
+ catch (Exception e)
+ {
+ sReturn = e.Message;
+ oCn.RollBack();
+ throw (e);
+ }
+ }
}
}
\ No newline at end of file
--
Gitblit v1.9.1