From 0f7e9424293db231a9092b3e89950d4430b43df5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=91=E5=8F=AB=E9=94=84=E5=A4=B4?= Date: Wed, 10 Jan 2024 10:46:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=A8=E8=96=AF=E7=B2=89=E6=80=BB=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LjReport/DayWhiteEmbryo/GhWuLiaoInitDb.cs | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjReport/DayWhiteEmbryo/GhWuLiaoInitDb.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjReport/DayWhiteEmbryo/GhWuLiaoInitDb.cs index c961a1a..a6977ec 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjReport/DayWhiteEmbryo/GhWuLiaoInitDb.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjReport/DayWhiteEmbryo/GhWuLiaoInitDb.cs @@ -1,4 +1,6 @@ -using Mesnac.Action.Base; +using DevExpress.Utils.Extensions; + +using Mesnac.Action.Base; using Mesnac.Codd.Session; using Mesnac.Controls.Default; @@ -130,7 +132,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjReport.DayWhiteEmbryo for (int j = 1; j <= 15; j++) { drTotal[j] = list - .Where(x => x.matCode == j).Sum(x => x.actValue).ToString("#0.00"); + .Where(x => x.matCode == j).Sum(x => x.actValue).ToString("#0.00"); } dt.Rows.Add(drTotal); @@ -138,6 +140,22 @@ namespace Mesnac.Action.ChemicalWeighing.LjReport.DayWhiteEmbryo dt.Columns.Remove("木薯粉总量"); dt.Columns.Remove("玉米粉总量"); + + for (int j = 0;j <= 4; j++) + { + var dr=dt.Rows[j]; + float total = 0; + for (int i = 1;i <=13;i++) + { + total += Convert.ToSingle(dr[i]); + } + dr[14] = total.ToString("#0.00"); + + + } + + + this.dataGridView.AutoGenerateColumns = true; this.dataGridView.DataSource = null; @@ -169,6 +187,8 @@ namespace Mesnac.Action.ChemicalWeighing.LjReport.DayWhiteEmbryo dt.Columns.Add("炭粉8总量", typeof(string)); dt.Columns.Add("回收总量", typeof(string)); + dt.Columns.Add("总计", typeof(string)); + return dt; } }