From 1a2bcf6e3f7dc6f8632dd4aa26233b5f3a5ec9d0 Mon Sep 17 00:00:00 2001 From: panhf <754998852@qq.com> Date: Mon, 29 Apr 2024 09:30:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A8=E9=87=8F=E6=9C=88=E6=8A=A5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ManageReportNew/MonthReportEdit.aspx.cs | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/SGGL/FineUIPro.Web/CQMS/ManageReportNew/MonthReportEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/ManageReportNew/MonthReportEdit.aspx.cs index 4ae5d19a..9ea69f95 100644 --- a/SGGL/FineUIPro.Web/CQMS/ManageReportNew/MonthReportEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/ManageReportNew/MonthReportEdit.aspx.cs @@ -1055,17 +1055,21 @@ namespace FineUIPro.Web.CQMS.ManageReportNew { DataTable source = ObjectToTable(Grid9.DataSource); int Quantity1Total = 0, Quantity2Total = 0; - foreach (DataRow row in source.Rows) + if (source!=null) { - Quantity1Total += Convert.ToInt32(row["Quantity1"]); - Quantity2Total += Convert.ToInt32(row["Quantity2"]); - } + foreach (DataRow row in source.Rows) + { + Quantity1Total += Convert.ToInt32(row["Quantity1"]); + Quantity2Total += Convert.ToInt32(row["Quantity2"]); + } - JObject summary = new JObject(); - summary.Add("UnitOrMajor", "合计"); - summary.Add("Quantity1", Quantity1Total.ToString()); - summary.Add("Quantity2", Quantity2Total.ToString()); - Grid9.SummaryData = summary; + JObject summary = new JObject(); + summary.Add("UnitOrMajor", "合计"); + summary.Add("Quantity1", Quantity1Total.ToString()); + summary.Add("Quantity2", Quantity2Total.ToString()); + Grid9.SummaryData = summary; + } + } public static DataTable ObjectToTable(object obj)