From 2659f28aa518630d4b789793ff3009d623cb05f8 Mon Sep 17 00:00:00 2001 From: kamonwan taengsuk Date: Wed, 17 May 2023 13:15:00 +0700 Subject: [PATCH] fixed --- Controllers/building_four.Controller.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Controllers/building_four.Controller.cs b/Controllers/building_four.Controller.cs index 82a0d36..e03baf7 100644 --- a/Controllers/building_four.Controller.cs +++ b/Controllers/building_four.Controller.cs @@ -225,10 +225,11 @@ namespace rmutr_report.Controllers } } - foreach (var expense in building_fours.expense_category) + if (building_fours.expense_category!=null) { - if (expense!=null) + foreach (var expense in building_fours.expense_category) { + var a = building_fours.expense_category.Where(d => d.amount == d.amount) .Sum(o => o.amount); building_fours.total_expense = a;