From ad876fd1256158b73e8f39d1e2d0739edabd011f Mon Sep 17 00:00:00 2001 From: duhe <226547893@qq.com> Date: 星期二, 14 十一月 2023 15:50:47 +0800 Subject: [PATCH] 根据用户获取用户关联客户的过滤条件 --- WebAPI/DLL/ClsSb_EquipRepairWorkBill.cs | 42 ++++++++++++++++++++++++++++++++++++++---- 1 files changed, 38 insertions(+), 4 deletions(-) diff --git a/WebAPI/DLL/ClsSb_EquipRepairWorkBill.cs b/WebAPI/DLL/ClsSb_EquipRepairWorkBill.cs index 7d04a25..9597e8d 100644 --- a/WebAPI/DLL/ClsSb_EquipRepairWorkBill.cs +++ b/WebAPI/DLL/ClsSb_EquipRepairWorkBill.cs @@ -9,6 +9,7 @@ { public Models.ClsSb_EquipRepairWorkBillMain omodel = new Models.ClsSb_EquipRepairWorkBillMain(); public List<Models.ClsSb_EquipRepairWorkBillSub> DetailColl = new List<Models.ClsSb_EquipRepairWorkBillSub>(); + public List<Model.ClsSb_EquipRepairWorkBillSub_Mater> DetailColl_Mater = new List<Model.ClsSb_EquipRepairWorkBillSub_Mater>(); public ClsSb_EquipRepairWorkBill() { @@ -71,6 +72,8 @@ DeleteRelation(ref sReturn, lngBillKey); //鍒犻櫎瀛愯〃 DeleteBillSub(lngBillKey); + //鍒犻櫎閰嶄欢鏁版嵁 + oCn.RunProc("delete from Sb_EquipRepairWorkBillSub_Mater where HInterID="+ lngBillKey); //鎻掑叆瀛愯〃 omodel.HInterID = lngBillKey; foreach (Models.ClsSb_EquipRepairWorkBillSub oSub in DetailColl) @@ -80,11 +83,27 @@ ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + ",HRepairID,HManagerID,HRepairExplanation,HEmpID" + ") values(" - + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + + + 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.HRepairID.ToString() + ",'"+ oSub.HManagerID.ToString() + "','" + oSub.HRepairExplanation + "'," + oSub.HEmpID.ToString() + ") "); } + + foreach (Model.ClsSb_EquipRepairWorkBillSub_Mater oSub in DetailColl_Mater) + { + oCn.RunProc("Insert into Sb_EquipRepairWorkBillSub_Mater " + + " (HInterID,HEntryID," + + "HCloseMan,HEntryCloseDate,HCloseType,HRemark," + + "HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney," + + "HQty,HMaterID,HUnitID,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.HUnitID.ToString() + "," + oSub.HQtyMust.ToString() + + "," + oSub.HManagerID.ToString() + ") "); + } + // //foreach (Model.ClsSb_EquipRepairWorkBillSub oSub in DetailColl) //{ @@ -128,7 +147,7 @@ " values('" + this.BillType + "','" + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" + ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + omodel.HMaker + "',getdate()" + ", " + omodel.HEquipID.ToString() + "," + omodel.HRepairID.ToString() + "," + omodel.HPlanTimes.ToString() + "," + omodel.HEmpID.ToString() + "," + omodel.HManagerID.ToString() + "," + omodel.HTimes.ToString() + - ", " + omodel.HDeptID.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "','" + omodel.HRepairBeginDate.ToShortDateString() + "','" + omodel.HRepairEndDate.ToShortDateString() + "','" + omodel.HRepairContent + "','" + omodel.HCycleUnit + "','" + + ", " + omodel.HDeptID.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "','" + omodel.HRepairBeginDate + "','" + omodel.HRepairEndDate + "','" + omodel.HRepairContent + "','" + omodel.HCycleUnit + "','" + omodel.HMainSourceBillType+"',"+ omodel.HMainSourceInterID.ToString()+","+ omodel.HMainSourceEntryID.ToString() + ") "); //鎻掑叆瀛愯〃 @@ -139,7 +158,7 @@ ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + ",HRepairID,HManagerID,HRepairExplanation,HEmpID" + ") values(" - + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + + + 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.HRepairID.ToString() + ",'" + oSub.HManagerID.ToString() + "','" + oSub.HRepairExplanation + "'," + oSub.HEmpID.ToString() + ")"); @@ -148,11 +167,26 @@ ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + ",HRepairID,HManagerID,HRepairExplanation,HEmpID" + ") values(" - + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + + + 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.HRepairID.ToString() + ",'"+ oSub.HManagerID.ToString() + "','" + oSub.HRepairExplanation + "'," + oSub.HEmpID.ToString() + ") "); } + + foreach (Model.ClsSb_EquipRepairWorkBillSub_Mater oSub in DetailColl_Mater) + { + oCn.RunProc("Insert into Sb_EquipRepairWorkBillSub_Mater " + + " (HInterID,HEntryID," + + "HCloseMan,HEntryCloseDate,HCloseType,HRemark," + + "HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney," + + "HQty,HMaterID,HUnitID,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.HUnitID.ToString() + "," + oSub.HQtyMust.ToString() + + "," + oSub.HManagerID.ToString() + ") "); + } // //foreach (Model.ClsSb_EquipRepairWorkBillSub oSub in DetailColl) //{ -- Gitblit v1.9.1