update total
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@@ -27,6 +28,20 @@ namespace rmutr_report.Controllers
|
||||
[ApiExplorerSettings(GroupName = "reports")]
|
||||
public IActionResult GetSum1Report([FromRoute] string type, [FromBody] List<budget_report> budget_reports)
|
||||
{
|
||||
foreach (var x in budget_reports)
|
||||
{
|
||||
int sum1 = budget_reports.Sum(g => int.Parse(g.salaya));
|
||||
x.sum1 = sum1;
|
||||
int sum2 = budget_reports.Sum(g => int.Parse(g.bophitphimuk));
|
||||
x.sum2 = sum2;
|
||||
int sum3 = budget_reports.Sum(g => int.Parse(g.pohchang));
|
||||
x.sum3 = sum3;
|
||||
int sum4 = budget_reports.Sum(g => int.Parse(g.klai_kangwon));
|
||||
x.sum4 = sum4;
|
||||
int sum5 = budget_reports.Sum(g => int.Parse(g.total));
|
||||
x.sum5 = sum5;
|
||||
|
||||
}
|
||||
Report report = new Report();
|
||||
report.Load(_setting.report_path + "budget_report.frx");
|
||||
report.RegisterData(budget_reports, "budget_report");
|
||||
|
||||
Reference in New Issue
Block a user