From d278cdf21025ef8403e2e1449a340fa51648adb9 Mon Sep 17 00:00:00 2001 From: kamonwan taengsuk Date: Mon, 15 May 2023 12:25:09 +0700 Subject: [PATCH] bug fixed --- .../durable_articles_three.Controller.cs | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Controllers/durable_articles_three.Controller.cs b/Controllers/durable_articles_three.Controller.cs index c08de22..6087182 100644 --- a/Controllers/durable_articles_three.Controller.cs +++ b/Controllers/durable_articles_three.Controller.cs @@ -29,25 +29,25 @@ namespace rmutr_report.Controllers public IActionResult GetHrReport([FromRoute] string type, [FromBody] durable_articles_three durable_articles_threes) { - Console.WriteLine(durable_articles_threes.specification_data[0].data_detail[0].data_detail2); - var a1 = durable_articles_threes.data.Where(d => d.amount == d.amount) - .Sum(o => o.amount); - durable_articles_threes.total_amount = a1; + //Console.WriteLine(durable_articles_threes.specification_data[0].data_detail[0].data_detail2); + var a1 = durable_articles_threes.data.Where(d => d.amount == d.amount) + .Sum(o => o.amount); + if (a1!=null) + { + durable_articles_threes.total_amount = a1; + + } - int a = 1; - foreach (var q in durable_articles_threes.quotation) - { + int a = 1; + foreach (var q in durable_articles_threes.quotation) + { - string t = "ใบเสนอราคาบริษัทที่ " + a++ +" "; - q.company = t + q.company; - //a++; - } - - foreach (var detail in durable_articles_threes.invest_detail) - { - - } + string t = "ใบเสนอราคาบริษัทที่ " + a++ +" "; + q.company = t + q.company; + //a++; + } + var _durable_articles_three = new List() {durable_articles_threes}; Report report = new Report();