diff --git a/Controllers/project_principle_rationale.Controller.cs b/Controllers/project_principle_rationale.Controller.cs index 5785918..bd9384a 100644 --- a/Controllers/project_principle_rationale.Controller.cs +++ b/Controllers/project_principle_rationale.Controller.cs @@ -19,7 +19,7 @@ namespace rmutr_report.Controllers public ProjectPrincipleRationale(Setting setting) { - this._setting = setting; + _setting = setting; } [HttpPost, Route("reports/project_principle_rationale/{type}")] @@ -27,36 +27,42 @@ namespace rmutr_report.Controllers public IActionResult GetProjectReport([FromRoute] string type, [FromBody] project_principle_rationale project) { var total = project.activity.Count; - //var total2 = project.sixteenth.Count; - foreach (var v in project.activity) + if (project.activity != null) { - if (v.activity != null) + foreach (var v in project.activity) { - //var total = project.activity.Select(r => r.count).Sum(t => t.Value); - project.together_with = "ประกอบด้วยกิจกรรมหรือโครงการย่อย " + total + " โครงการดังนี้คือ"; - } - else - { - project.together_with = null; + if (v.activity != null) + { + //var total = project.activity.Select(r => r.count).Sum(t => t.Value); + project.together_with = "ประกอบด้วยกิจกรรมหรือโครงการย่อย " + total + " โครงการดังนี้คือ"; + } + else + { + project.together_with = null; + } } } - foreach (var v in project.eighth) + if (project.eighth != null) { - string na = "ประเด็นยุทธศาสตร์ที่ "; - v.strategic_issues = na + v.strategic_issues; - string na2 = "กลยุทธ์ที่ "; - v.measure = na2 + v.measure; + foreach (var v in project.eighth) + { + string na = "ประเด็นยุทธศาสตร์ที่ "; + v.strategic_issues = na + v.strategic_issues; + string na2 = "กลยุทธ์ที่ "; + v.measure = na2 + v.measure; + } } - foreach (var vv in project.fourteenth) + if (project.fourteenth != null) { - - // string na = "องค์ประกอบที่ " ; - // vv.component = na + vv.component; - string na2 = "ตัวบ่งชี้ที่ "; - vv.indicator = na2 + vv.indicator; - + foreach (var vv in project.fourteenth) + { + // string na = "องค์ประกอบที่ " ; + // vv.component = na + vv.component; + string na2 = "ตัวบ่งชี้ที่ "; + vv.indicator = na2 + vv.indicator; + } } if (project.eighteenth != null) @@ -204,36 +210,42 @@ namespace rmutr_report.Controllers public IActionResult GetProject2Report([FromRoute] string type, [FromBody] project_principle_rationale project) { var total = project.activity.Count; - //var total2 = project.sixteenth.Count; - foreach (var v in project.activity) + if (project.activity != null) { - if (v.activity != null) + foreach (var v in project.activity) { - //var total = project.activity.Select(r => r.count).Sum(t => t.Value); - project.together_with = "ประกอบด้วยกิจกรรมหรือโครงการย่อย " + total + " โครงการดังนี้คือ"; - } - else - { - project.together_with = null; + if (v.activity != null) + { + //var total = project.activity.Select(r => r.count).Sum(t => t.Value); + project.together_with = "ประกอบด้วยกิจกรรมหรือโครงการย่อย " + total + " โครงการดังนี้คือ"; + } + else + { + project.together_with = null; + } } } - foreach (var v in project.eighth) + if (project.eighth != null) { - string na = "ประเด็นยุทธศาสตร์ที่ "; - v.strategic_issues = na + v.strategic_issues; - string na2 = "กลยุทธ์ที่ "; - v.measure = na2 + v.measure; + foreach (var v in project.eighth) + { + string na = "ประเด็นยุทธศาสตร์ที่ "; + v.strategic_issues = na + v.strategic_issues; + string na2 = "กลยุทธ์ที่ "; + v.measure = na2 + v.measure; + } } - foreach (var vv in project.fourteenth) + if (project.fourteenth != null) { - + foreach (var vv in project.fourteenth) + { // string na = "องค์ประกอบที่ " ; // vv.component = na + vv.component; string na2 = "ตัวบ่งชี้ที่ "; vv.indicator = na2 + vv.indicator; - + } } if (project.eighteenth != null) diff --git a/bin/Debug/net5.0/rmutr_report.dll b/bin/Debug/net5.0/rmutr_report.dll index 008debb..4e78ec1 100644 Binary files a/bin/Debug/net5.0/rmutr_report.dll and b/bin/Debug/net5.0/rmutr_report.dll differ diff --git a/bin/Debug/net5.0/rmutr_report.pdb b/bin/Debug/net5.0/rmutr_report.pdb index 3ea637b..f4af2b0 100644 Binary files a/bin/Debug/net5.0/rmutr_report.pdb and b/bin/Debug/net5.0/rmutr_report.pdb differ diff --git a/bin/Debug/netcoreapp3.1/rmutr_report.dll b/bin/Debug/netcoreapp3.1/rmutr_report.dll index bbf1cf1..afc7f19 100644 Binary files a/bin/Debug/netcoreapp3.1/rmutr_report.dll and b/bin/Debug/netcoreapp3.1/rmutr_report.dll differ diff --git a/bin/Debug/netcoreapp3.1/rmutr_report.pdb b/bin/Debug/netcoreapp3.1/rmutr_report.pdb index 4bdcd2a..844d9f6 100644 Binary files a/bin/Debug/netcoreapp3.1/rmutr_report.pdb and b/bin/Debug/netcoreapp3.1/rmutr_report.pdb differ diff --git a/obj/Debug/net5.0/rmutr_report.dll b/obj/Debug/net5.0/rmutr_report.dll index 008debb..4e78ec1 100644 Binary files a/obj/Debug/net5.0/rmutr_report.dll and b/obj/Debug/net5.0/rmutr_report.dll differ diff --git a/obj/Debug/net5.0/rmutr_report.pdb b/obj/Debug/net5.0/rmutr_report.pdb index 3ea637b..f4af2b0 100644 Binary files a/obj/Debug/net5.0/rmutr_report.pdb and b/obj/Debug/net5.0/rmutr_report.pdb differ diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.dll b/obj/Debug/netcoreapp3.1/rmutr_report.dll index bbf1cf1..afc7f19 100644 Binary files a/obj/Debug/netcoreapp3.1/rmutr_report.dll and b/obj/Debug/netcoreapp3.1/rmutr_report.dll differ diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.pdb b/obj/Debug/netcoreapp3.1/rmutr_report.pdb index 4bdcd2a..844d9f6 100644 Binary files a/obj/Debug/netcoreapp3.1/rmutr_report.pdb and b/obj/Debug/netcoreapp3.1/rmutr_report.pdb differ diff --git a/obj/rider.project.restore.info b/obj/rider.project.restore.info index c6ca5de..79a4037 100644 --- a/obj/rider.project.restore.info +++ b/obj/rider.project.restore.info @@ -1 +1 @@ -16932047384453843 \ No newline at end of file +16932907245525519 \ No newline at end of file