From 250e09a3553b2a72b94684ab4da184eb3171a77d Mon Sep 17 00:00:00 2001 From: gaofei1985 <181547018@qq.com> Date: Wed, 25 Oct 2023 14:23:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ContractCompile/PhtglContracttrackService .cs | 14 ++++---------- .../PHTGL/ContractCompile/ContractWBS.aspx.cs | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs b/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs index 32643bc9..d8539f22 100644 --- a/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs +++ b/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs @@ -1100,11 +1100,8 @@ namespace BLL decimal physicalCompletionQuantity = 0, materialConsumption = 0; if (we.Count() > 0) { - foreach (var w in we) - { - physicalCompletionQuantity += w.PhysicalCompletionQuantity ?? 0; - materialConsumption += w.MaterialConsumption ?? 0; - } + physicalCompletionQuantity = we.Sum(x => x.PhysicalCompletionQuantity ?? 0); + materialConsumption = we.Sum(x => x.MaterialConsumption ?? 0); row[9] = physicalCompletionQuantity; row[10] = materialConsumption; } @@ -1188,11 +1185,8 @@ namespace BLL decimal physicalCompletionQuantity = 0, materialConsumption = 0; if (we.Count() > 0) { - foreach (var w in we) - { - physicalCompletionQuantity += w.PhysicalCompletionQuantity ?? 0; - materialConsumption += w.MaterialConsumption ?? 0; - } + physicalCompletionQuantity = we.Sum(x => x.PhysicalCompletionQuantity ?? 0); + materialConsumption = we.Sum(x => x.MaterialConsumption ?? 0); row[9] = physicalCompletionQuantity; row[10] = materialConsumption; } diff --git a/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractWBS.aspx.cs b/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractWBS.aspx.cs index 64686ba1..7b84004e 100644 --- a/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractWBS.aspx.cs +++ b/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractWBS.aspx.cs @@ -177,7 +177,7 @@ namespace FineUIPro.Web.PHTGL.ContractCompile return; } string ID = Grid1.SelectedRow.DataKeys[0].ToString(); - var model = BLL.PhtglContractTrackService.GetPHTGL_ContractTrackById(ID[0].ToString()); + var model = BLL.PhtglContractTrackService.GetPHTGL_ContractTrackById(ID); if (model != null) ///已上报时不能删除 { PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ContractTrackMatchWBS.aspx?ContractTrackId={0}", ID, "编辑 - ")));