diff --git a/Controllers/PlantGeneticConservationProject.Controller.cs b/Controllers/PlantGeneticConservationProject.Controller.cs index 4bd162a..e796304 100644 --- a/Controllers/PlantGeneticConservationProject.Controller.cs +++ b/Controllers/PlantGeneticConservationProject.Controller.cs @@ -94,8 +94,16 @@ namespace rmutr_report.Controllers sixteenthData.bophitphimuk_total = sum2; sixteenthData.pohchang_total = sum3; sixteenthData.klai_kangwon_total = sum4; - sixteenthData.activity_table = a + sixteenthData.activity_table; - t++; + if (sixteenthData.activity_table != null) + { + sixteenthData.activity_table = a + sixteenthData.activity_table; + t++; + } + + if (sixteenthData.activity_table == null) + { + sixteenthData.activity_table = null; + } } } @@ -105,7 +113,17 @@ namespace rmutr_report.Controllers { int t = 1; string a = "กิจกรรมที่ "; - v.activity = a + v.activity; + if (v.activity != null) + { + v.activity = a + v.activity; + t++; + } + + if (v.activity == null) + { + v.activity = null; + } + foreach (var vv in v.seventeenths) { string na = "ครั้งที่ "; @@ -139,6 +157,19 @@ namespace rmutr_report.Controllers { foreach (var v in project.eighteenth) { + int t = 1; + string a = "กิจกรรมที่ "; + if (v.activity != null) + { + v.activity = a + v.activity; + t++; + } + + if (v.activity == null) + { + v.activity = null; + } + foreach (var vv in v.eighteenths) { string na = "ครั้งที่ "; @@ -153,25 +184,64 @@ namespace rmutr_report.Controllers } } + if (project.nineteenth != null) + { + foreach (var v in project.nineteenth) + { + foreach (var vv in v.nineteenth_data_header) + { + int t = 1; + string a = "กิจกรรมที่ "; + if (vv.activity != null) + { + vv.activity = a + vv.activity; + t++; + } + + if (vv.activity == null) + { + vv.activity = null; + } + } + } + } + if (project.total_target != null) { project.text1 = "ผลรวมกลุ่มเป้าหมาย " + project.total_target; } + if (project.total_target == null) + { + project.text1 = "ผลรวมกลุ่มเป้าหมาย -"; + } + if (project.total_board != null) { project.text2 = "ผลรวมคณะกรรมการ " + project.total_board; } + if (project.total_board == null) + { + project.text2 = "ผลรวมคณะกรรมการ -"; + } + if (project.twenty_one != null) { foreach (var v in project.twenty_one) { - if (v.activity != null || v.activity != "") + int t = 1; + string a = "กิจกรรมที่ "; + if (v.activity != null) { - v.activity = v.activity; + v.activity = a + v.activity; + t++; } + if (v.activity == null) + { + v.activity = null; + } foreach (var vv in v.twenty_ones) { // if (vv.clause1 != null || vv.clause1 != "") @@ -268,6 +338,25 @@ namespace rmutr_report.Controllers } } + if (project.twenty_four != null) + { + foreach (var v in project.twenty_four) + { + int t = 1; + string a = "กิจกรรมที่ "; + if (v.activity != null) + { + v.activity = a + v.activity; + t++; + } + + if (v.activity == null) + { + v.activity = null; + } + } + } + var _project = new List() { project }; Report report = new Report(); diff --git a/Controllers/RoThree.Controller.cs b/Controllers/RoThree.Controller.cs index 67176fe..c0b2d29 100644 --- a/Controllers/RoThree.Controller.cs +++ b/Controllers/RoThree.Controller.cs @@ -1235,6 +1235,7 @@ namespace rmutr_report.Controllers return Ok(); } + [SwaggerOperation("2ค่าตอบแทนผู้ปฏิบัติงานให้ราชการ_6 7 8")] [HttpPost, Route("reports/consultant_compensation/{type}")] [ApiExplorerSettings(GroupName = "reports")] @@ -1243,36 +1244,41 @@ namespace rmutr_report.Controllers { var types = compensation.data.ToList(); - if (compensation.topic_type==1) + if (compensation.topic_type == 1) { compensation.topic_name = "ค่าตอบแทนที่ปรึกษา"; } - if (compensation.topic_type==2) + + if (compensation.topic_type == 2) { compensation.topic_name = "ค่าตอบแทนเหมาจ่ายจัดหารถประจำตำแหน่ง"; } - if (compensation.topic_type==3) + if (compensation.topic_type == 3) { compensation.topic_name = "ค่าตอบแทนอื่น ๆ"; } - if (compensation.topic_type==4) + if (compensation.topic_type == 4) { compensation.topic_name = "ค่าคณะกรรมการตรวจการจ้าง"; } - if (compensation.topic_type==5) + + if (compensation.topic_type == 5) { compensation.topic_name = "ค่าคณะกรรมการตรวจรับพัสดุ"; } - if (compensation.topic_type==6) + + if (compensation.topic_type == 6) { compensation.topic_name = "ค่าคณะกรรมการกำหนดราคากลาง"; } + foreach (var detail in compensation.data) { detail.total_amount = detail.quantity_day * detail.quantity_person * detail.rate; } + compensation.total_amount = types.Sum(d => d.total_amount); var compensations = new List() { compensation }; Report report = new Report(); @@ -1344,33 +1350,67 @@ namespace rmutr_report.Controllers public IActionResult GetCalReport([FromRoute] string type, [FromBody] calculate_meeting_expenses calculate) { - if (calculate.topic_type==1) + var c = calculate.data.ToList(); + if (calculate.topic_type == 1) { calculate.text1 = "ค่าใช้สอย : ค่าอาหารว่าง และค่าอาหารกลางวันในการประชุม"; calculate.text2 = "ผลการเบิกจ่าย ค่าอาหารว่าง\nและค่าอาหารกลางวันเบิกจ่ายจริง"; calculate.text3 = "อัตราค่าใช้จ่ายค่าอาหารว่าง\nและค่าอาหารกลางวัน"; calculate.text4 = "รวมค่าอาหารว่างและค่าอาหารกลางวัน"; } - if (calculate.topic_type==2) + + if (calculate.topic_type == 2) { calculate.text1 = "ค่าตอบแทน : ค่าเบี้ยประชุมคณะกรรมการ"; calculate.text2 = "ผลการเบิกจ่าย ค่าเบี้ยประชุมเบิกจ่ายจริง"; calculate.text3 = "อัตราค่าเบี้ยประชุม"; calculate.text4 = "รวมค่าเบี้ยประชุม"; } + + //var newlist = new List() { }; + //var newlist2 = newlist.SelectMany(newlist => newlist.data); int n = 1; - foreach (var data in calculate.data) + foreach (var data in calculate.data) { - if (data.topic_type==1) + if (data.topic_type == 1) { data.row_no = null; data.no = n.ToString(); n++; - } + } + + if (data.topic_type == 2) + { + data.total = data.expense_rate * data.count_person * data.count_meetings; + } } + calculate.disbursement_result = c.Where(e => e.topic_type == 1).Sum(d => d.disbursement_result); + calculate.expense_rate = c.Where(e => e.topic_type == 1).Sum(d => d.expense_rate); + calculate.count_person = c.Where(e => e.topic_type == 1).Sum(d => d.count_person); + calculate.count_meetings = c.Where(e => e.topic_type == 1).Sum(d => d.count_meetings); + calculate.total = c.Where(e => e.topic_type == 1).Sum(d => d.total); var calculateMeeting = new List() { calculate }; + // calculate.data.Add(new calculate_meeting_expenses_data_datail() + // { + // topic_type = 1, + // disbursement_result = calculateMeeting.SelectMany(d => d.data).Where(t => t.topic_type == 2) + // .Sum(c => c.disbursement_result), + // count_person = calculateMeeting.SelectMany(d => d.data).Where(t => t.topic_type == 2) + // .Sum(c => c.count_person) + // }); + // foreach (var cc in c) + // { + // if (cc.topic_type==1) + // { + // cc.disbursement_result = calculateMeeting.SelectMany(d => d.data).Where(t => t.topic_type == 2) + // .Sum(c => c.disbursement_result); + // cc.count_person = calculateMeeting.SelectMany(d => d.data).Where(t => t.topic_type == 2) + // .Sum(c => c.count_person); + // } + // + // } Report report = new Report(); report.Load(_setting.report_path + "calculate_meeting_expenses.frx"); report.RegisterData(calculateMeeting, "calculate_meeting_expenses"); diff --git a/Controllers/project_principle_rationale.Controller.cs b/Controllers/project_principle_rationale.Controller.cs index e2fc8c1..8e7c1c8 100644 --- a/Controllers/project_principle_rationale.Controller.cs +++ b/Controllers/project_principle_rationale.Controller.cs @@ -67,8 +67,16 @@ namespace rmutr_report.Controllers sixteenthData.bophitphimuk_total = sum2; sixteenthData.pohchang_total = sum3; sixteenthData.klai_kangwon_total = sum4; - sixteenthData.activity_table = a + sixteenthData.activity_table; - t++; + if (sixteenthData.activity_table != null) + { + sixteenthData.activity_table = a + sixteenthData.activity_table; + t++; + } + + if (sixteenthData.activity_table == null) + { + sixteenthData.activity_table = null; + } } } @@ -78,7 +86,17 @@ namespace rmutr_report.Controllers { int t = 1; string a = "กิจกรรมที่ "; - v.activity = a + v.activity; + if (v.activity != null) + { + v.activity = a + v.activity; + t++; + } + + if (v.activity == null) + { + v.activity = null; + } + foreach (var vv in v.seventeenths) { string na = "ครั้งที่ "; @@ -112,6 +130,20 @@ namespace rmutr_report.Controllers { foreach (var v in project.eighteenth) { + int t = 1; + string a = "กิจกรรมที่ "; + + if (v.activity != null) + { + v.activity = a + v.activity; + t++; + } + + if (v.activity == null) + { + v.activity = null; + } + foreach (var vv in v.eighteenths) { string na = "ครั้งที่ "; @@ -126,16 +158,48 @@ namespace rmutr_report.Controllers } } + if (project.nineteenth != null) + { + foreach (var v in project.nineteenth) + { + foreach (var vv in v.nineteenth_data_header) + { + int t = 1; + string a = "กิจกรรมที่ "; + if (vv.activity != null) + { + vv.activity = a + vv.activity; + t++; + } + + if (vv.activity == null) + { + vv.activity = null; + } + } + } + } + if (project.total_target != null) { project.text1 = "ผลรวมกลุ่มเป้าหมาย " + project.total_target; } + if (project.total_target == null) + { + project.text1 = "ผลรวมกลุ่มเป้าหมาย -"; + } + if (project.total_board != null) { project.text2 = "ผลรวมคณะกรรมการ " + project.total_board; } + if (project.total_board == null) + { + project.text2 = "ผลรวมคณะกรรมการ -"; + } + if (project.twenty_one != null) { foreach (var v in project.twenty_one) @@ -262,10 +326,23 @@ namespace rmutr_report.Controllers if (project.twenty_four != null) { + int no = 1; - foreach (var tw in project.twenty_four) + foreach (var v in project.twenty_four) { - foreach (var dataDetail in tw.twenty_fours) + int t = 1; + string aa = "กิจกรรมที่ "; + if (v.activity != null) + { + v.activity = aa + v.activity; + t++; + } + + if (v.activity == null) + { + v.activity = null; + } + foreach (var dataDetail in v.twenty_fours) { string a = "ชื่อผู้รับผิดชอบ กิจกรรมที่ " + no; no++; @@ -371,266 +448,220 @@ namespace rmutr_report.Controllers return Ok(); } - [HttpPost, Route("reports/project_principle_rationale_no_activity/{type}")] - [ApiExplorerSettings(GroupName = "reports")] - public IActionResult GetProject2Report([FromRoute] string type, - [FromBody] project_principle_rationale project) - { - var total = project.activity.Count; - if (project.activity != null) - { - foreach (var v in project.activity) - { - 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; - } - } - } - - if (project.eighth != null) - { - foreach (var v in project.eighth) - { - string na = "ประเด็นยุทธศาสตร์ที่ "; - v.strategic_issues = na + v.strategic_issues; - string na2 = "กลยุทธ์ที่ "; - v.measure = na2 + v.measure; - } - } - - 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.sixteenths != null) - { - foreach (var sixteenthData in project.sixteenths) - { - var sum1 = sixteenthData.sixteenths2.Sum(d => d.salaya); - var sum2 = sixteenthData.sixteenths2.Sum(d => d.bophitphimuk); - var sum3 = sixteenthData.sixteenths2.Sum(d => d.pohchang); - var sum4 = sixteenthData.sixteenths2.Sum(d => d.klai_kangwon); - sixteenthData.salaya_total = sum1; - sixteenthData.bophitphimuk_total = sum2; - sixteenthData.pohchang_total = sum3; - sixteenthData.klai_kangwon_total = sum4; - } - } - - if (project.eighteenth != null) - { - foreach (var v in project.eighteenth) - { - foreach (var vv in v.eighteenths) - { - string na = "ครั้งที่ "; - vv.the_time = na + vv.the_time; - string na2 = " จำนวน "; - vv.count_day = na2 + vv.count_day + " วัน"; - if (project.count_day != null) - { - project.text3 = "จำนวน " + project.count_day + " วัน"; - } - } - } - } - - if (project.total_target != null) - { - project.text1 = "ผลรวมกลุ่มเป้าหมาย " + project.total_target; - } - - if (project.total_board != null) - { - project.text2 = "ผลรวมคณะกรรมการ " + project.total_board; - } - - if (project.twenty_one != null) - { - // foreach (var vv in project.twenty_one) - // { - // if (vv.activity != null || vv.activity!= "") - // { - // vv.activity = vv.activity; - // } - // if (vv.clause1 != null || vv.clause1!= "") - // { - // vv.clause1 = vv.clause1; - // } - // if (vv.clause2 != null || vv.clause2!= "") - // { - // vv.clause2 = vv.clause2; - // } - // if (vv.clause3 != null || vv.clause3!= "") - // { - // vv.clause3 = vv.clause3; - // } - // if (vv.clause4 != null || vv.clause4!= "") - // { - // vv.clause4 = vv.clause4; - // } - // if (vv.count_unit != null || vv.count_unit != "") - // { - // string na = "ผู้เข้าร่วมโครงการ จำนวน "; - // string na2 = " หน่วยนับ"; - // project.text1 = na + vv.count_unit + na2; - // } - // - // if (vv.count_project != null || vv.count_project != "") - // { - // string na = "จำนวนครั้งที่ดำเนินโครงการ "; - // string na2 = " ครั้ง"; - // project.text2 = na + vv.count_project + na2; - // } - // - // if (vv.count_training != null || vv.count_training != "") - // { - // string na = "จำนวนการจัดอบรมและสัมมนา "; - // string na2 = " เรื่อง"; - // project.text3 = na + vv.count_training + na2; - // } - // - // if (vv.count_knowledge != null || vv.count_knowledge != "") - // { - // string na = "จำนวนเผยแพร่ความรู้บริการวิชาการ "; - // string na2 = " ครั้ง"; - // project.text4 = na + vv.count_knowledge + na2; - // } - // string na3 = "วัน/เดือน/ปี ที่จะดำเนินโครงการ "; - // string na4 = " ถึง "; - // project.text5 = na3 + vv.project_start_date + na4 + vv.project_end_date; - // string na5 = "โครงการแล้วเสร็จตามเวลาที่กำหนด (ร้อยละ) "; - // project.text6 = na5 + vv.percentage_finish; - // - // } - - if (project.twenty_one == null) - { - project.twenty_one = null; - } - } - - if (project.twenty_four != null) - { - int no = 1; - foreach (var tw in project.twenty_four) - { - foreach (var dataDetail in tw.twenty_fours) - { - string a = "ชื่อผู้รับผิดชอบ กิจกรรมที่ " + no; - no++; - if (dataDetail.responsible_person != null) - { - dataDetail.text1 = a + " " + dataDetail.responsible_person; - } - - string b = "หน่วยงาน / คณะ "; - if (dataDetail.agency != null) - { - dataDetail.text2 = b + dataDetail.agency; - } - - string c = "พื้นที่ "; - if (dataDetail.area != null) - { - dataDetail.text3 = c + dataDetail.area; - } - - string d = "เบอร์โทรศัพท์ภายใน "; - if (dataDetail.telephone_number != null) - { - dataDetail.text4 = d + dataDetail.telephone_number; - } - - string e = "เบอร์มือถือ "; - if (dataDetail.mobile_number != null) - { - dataDetail.text5 = e + dataDetail.mobile_number; - } - - string f = "อีเมล "; - if (dataDetail.email != null) - { - dataDetail.text6 = f + dataDetail.email; - } - } - } - } - - if (project.twenty_fifth != null) - { - foreach (var fifthData in project.twenty_fifth) - { - foreach (var acti in fifthData.activity) - { - fifthData.activitys = acti; - } - - foreach (var locat in fifthData.location) - { - fifthData.locations = locat; - } - } - } - - var _project = new List() { project }; - - Report report = new Report(); - report.Load(_setting.report_path + "project_principle_rationale_no_activity.frx"); - report.RegisterData(_project, "project_principle_rationale"); - report.Prepare(); - - MemoryStream stream = new MemoryStream(); - switch (type) - { - case "pdf": - PDFExport pdf = new PDFExport(); - report.Export(pdf, stream); - stream.Seek(0, SeekOrigin.Begin); - return File(stream, "application/pdf"); - - case "xls": - case "xlsx": - Excel2007Export excel = new Excel2007Export(); - report.Export(excel, stream); - stream.Seek(0, SeekOrigin.Begin); - return File(stream, "application/vnd.ms-excel"); - break; - case "mht": - MHTExport mht = new MHTExport(); - report.Export(mht, stream); - stream.Seek(0, SeekOrigin.Begin); - return File(stream, "multipart/related"); - break; - case "csv": - CSVExport csv = new CSVExport(); - report.Export(csv, stream); - stream.Seek(0, SeekOrigin.Begin); - return File(stream, "text/csv"); - break; - case "doc": - case "docx": - Word2007Export word = new Word2007Export(); - report.Export(word, stream); - stream.Seek(0, SeekOrigin.Begin); - return File(stream, "appllication/vnd.ms-word"); - break; - } - - return Ok(); - } + // [HttpPost, Route("reports/project_principle_rationale_no_activity/{type}")] + // [ApiExplorerSettings(GroupName = "reports")] + // public IActionResult GetProject2Report([FromRoute] string type, + // [FromBody] project_principle_rationale project) + // { + // var total = project.activity.Count; + // if (project.activity != null) + // { + // foreach (var v in project.activity) + // { + // 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; + // } + // } + // } + // + // if (project.eighth != null) + // { + // foreach (var v in project.eighth) + // { + // string na = "ประเด็นยุทธศาสตร์ที่ "; + // v.strategic_issues = na + v.strategic_issues; + // string na2 = "กลยุทธ์ที่ "; + // v.measure = na2 + v.measure; + // } + // } + // + // 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.sixteenths != null) + // { + // foreach (var sixteenthData in project.sixteenths) + // { + // var sum1 = sixteenthData.sixteenths2.Sum(d => d.salaya); + // var sum2 = sixteenthData.sixteenths2.Sum(d => d.bophitphimuk); + // var sum3 = sixteenthData.sixteenths2.Sum(d => d.pohchang); + // var sum4 = sixteenthData.sixteenths2.Sum(d => d.klai_kangwon); + // sixteenthData.salaya_total = sum1; + // sixteenthData.bophitphimuk_total = sum2; + // sixteenthData.pohchang_total = sum3; + // sixteenthData.klai_kangwon_total = sum4; + // } + // } + // + // if (project.eighteenth != null) + // { + // foreach (var v in project.eighteenth) + // { + // foreach (var vv in v.eighteenths) + // { + // string na = "ครั้งที่ "; + // vv.the_time = na + vv.the_time; + // string na2 = " จำนวน "; + // vv.count_day = na2 + vv.count_day + " วัน"; + // if (project.count_day != null) + // { + // project.text3 = "จำนวน " + project.count_day + " วัน"; + // } + // } + // } + // } + // + // if (project.total_target != null) + // { + // project.text1 = "ผลรวมกลุ่มเป้าหมาย " + project.total_target; + // } + // + // if (project.total_board != null) + // { + // project.text2 = "ผลรวมคณะกรรมการ " + project.total_board; + // } + // + // if (project.twenty_one != null) + // { + // // foreach (var vv in project.twenty_one) + // // { + // // if (vv.activity != null || vv.activity!= "") + // // { + // // vv.activity = vv.activity; + // // } + // // if (vv.clause1 != null || vv.clause1!= "") + // // { + // // vv.clause1 = vv.clause1; + // // } + // // if (vv.clause2 != null || vv.clause2!= "") + // // { + // // vv.clause2 = vv.clause2; + // // } + // // if (vv.clause3 != null || vv.clause3!= "") + // // { + // // vv.clause3 = vv.clause3; + // // } + // // if (vv.clause4 != null || vv.clause4!= "") + // // { + // // vv.clause4 = vv.clause4; + // // } + // // if (vv.count_unit != null || vv.count_unit != "") + // // { + // // string na = "ผู้เข้าร่วมโครงการ จำนวน "; + // // string na2 = " หน่วยนับ"; + // // project.text1 = na + vv.count_unit + na2; + // // } + // // + // // if (vv.count_project != null || vv.count_project != "") + // // { + // // string na = "จำนวนครั้งที่ดำเนินโครงการ "; + // // string na2 = " ครั้ง"; + // // project.text2 = na + vv.count_project + na2; + // // } + // // + // // if (vv.count_training != null || vv.count_training != "") + // // { + // // string na = "จำนวนการจัดอบรมและสัมมนา "; + // // string na2 = " เรื่อง"; + // // project.text3 = na + vv.count_training + na2; + // // } + // // + // // if (vv.count_knowledge != null || vv.count_knowledge != "") + // // { + // // string na = "จำนวนเผยแพร่ความรู้บริการวิชาการ "; + // // string na2 = " ครั้ง"; + // // project.text4 = na + vv.count_knowledge + na2; + // // } + // // string na3 = "วัน/เดือน/ปี ที่จะดำเนินโครงการ "; + // // string na4 = " ถึง "; + // // project.text5 = na3 + vv.project_start_date + na4 + vv.project_end_date; + // // string na5 = "โครงการแล้วเสร็จตามเวลาที่กำหนด (ร้อยละ) "; + // // project.text6 = na5 + vv.percentage_finish; + // // + // // } + // + // if (project.twenty_one == null) + // { + // project.twenty_one = null; + // } + // } + // + // + // if (project.twenty_fifth != null) + // { + // foreach (var fifthData in project.twenty_fifth) + // { + // foreach (var acti in fifthData.activity) + // { + // fifthData.activitys = acti; + // } + // + // foreach (var locat in fifthData.location) + // { + // fifthData.locations = locat; + // } + // } + // } + // + // var _project = new List() { project }; + // + // Report report = new Report(); + // report.Load(_setting.report_path + "project_principle_rationale_no_activity.frx"); + // report.RegisterData(_project, "project_principle_rationale"); + // report.Prepare(); + // + // MemoryStream stream = new MemoryStream(); + // switch (type) + // { + // case "pdf": + // PDFExport pdf = new PDFExport(); + // report.Export(pdf, stream); + // stream.Seek(0, SeekOrigin.Begin); + // return File(stream, "application/pdf"); + // + // case "xls": + // case "xlsx": + // Excel2007Export excel = new Excel2007Export(); + // report.Export(excel, stream); + // stream.Seek(0, SeekOrigin.Begin); + // return File(stream, "application/vnd.ms-excel"); + // break; + // case "mht": + // MHTExport mht = new MHTExport(); + // report.Export(mht, stream); + // stream.Seek(0, SeekOrigin.Begin); + // return File(stream, "multipart/related"); + // break; + // case "csv": + // CSVExport csv = new CSVExport(); + // report.Export(csv, stream); + // stream.Seek(0, SeekOrigin.Begin); + // return File(stream, "text/csv"); + // break; + // case "doc": + // case "docx": + // Word2007Export word = new Word2007Export(); + // report.Export(word, stream); + // stream.Seek(0, SeekOrigin.Begin); + // return File(stream, "appllication/vnd.ms-word"); + // break; + // } + // + // return Ok(); + // } } } \ No newline at end of file diff --git a/Controllers/project_request_thailand.Controller.cs b/Controllers/project_request_thailand.Controller.cs index 9010859..0b2ba10 100644 --- a/Controllers/project_request_thailand.Controller.cs +++ b/Controllers/project_request_thailand.Controller.cs @@ -112,8 +112,16 @@ namespace rmutr_report.Controllers sixteenthData.bophitphimuk_total = sum2; sixteenthData.pohchang_total = sum3; sixteenthData.klai_kangwon_total = sum4; - sixteenthData.activity_table = a + sixteenthData.activity_table; - t++; + if (sixteenthData.activity_table != null) + { + sixteenthData.activity_table = a + sixteenthData.activity_table; + t++; + } + + if (sixteenthData.activity_table == null) + { + sixteenthData.activity_table = null; + } } } @@ -123,7 +131,17 @@ namespace rmutr_report.Controllers { int t = 1; string a = "กิจกรรมที่ "; - v.activity = a + v.activity; + if (v.activity != null) + { + v.activity = a + v.activity; + t++; + } + + if (v.activity == null) + { + v.activity = null; + } + foreach (var vv in v.seventeenths) { string na = "ครั้งที่ "; @@ -157,6 +175,19 @@ namespace rmutr_report.Controllers { foreach (var v in project.eighteenth) { + int t = 1; + string a = "กิจกรรมที่ "; + if (v.activity != null) + { + v.activity = a + v.activity; + t++; + } + + if (v.activity == null) + { + v.activity = null; + } + foreach (var vv in v.eighteenths) { string na = "ครั้งที่ "; @@ -171,23 +202,63 @@ namespace rmutr_report.Controllers } } + if (project.nineteenth != null) + { + foreach (var v in project.nineteenth) + { + foreach (var vv in v.nineteenth_data_header) + { + int t = 1; + string a = "กิจกรรมที่ "; + if (vv.activity != null) + { + vv.activity = a + vv.activity; + t++; + } + + if (vv.activity == null) + { + vv.activity = null; + } + } + } + } + if (project.total_target != null) { project.text1 = "ผลรวมกลุ่มเป้าหมาย " + project.total_target; } + if (project.total_target == null) + { + project.text1 = "ผลรวมกลุ่มเป้าหมาย -"; + } + if (project.total_board != null) { project.text2 = "ผลรวมคณะกรรมการ " + project.total_board; } + if (project.total_board == null) + { + project.text2 = "ผลรวมคณะกรรมการ -"; + } + if (project.twenty_one != null) { foreach (var v in project.twenty_one) { - if (v.activity != null || v.activity != "") + int t = 1; + string a = "กิจกรรมที่ "; + if (v.activity != null) { - v.activity = v.activity; + v.activity = a + v.activity; + t++; + } + + if (v.activity == null) + { + v.activity = null; } foreach (var vv in v.twenty_ones) @@ -266,7 +337,24 @@ namespace rmutr_report.Controllers } } } + if (project.twenty_four != null) + { + foreach (var v in project.twenty_four) + { + int t = 1; + string a = "กิจกรรมที่ "; + if (v.activity != null) + { + v.activity = a + v.activity; + t++; + } + if (v.activity == null) + { + v.activity = null; + } + } + } var _project = new List() { project }; diff --git a/Models/RoReport/land_rent.cs b/Models/RoReport/land_rent.cs new file mode 100644 index 0000000..2277191 --- /dev/null +++ b/Models/RoReport/land_rent.cs @@ -0,0 +1,20 @@ +using System.Collections.Generic; + +namespace rmutr_report.Models.RoThree +{ + public class land_rent + { + public string budget_year { get; set; } + public decimal? total_amount { get; set; } + public List data { get; set; } + } + + public class land_rent_data_datail + { + public string list { get; set; } + public decimal? amount { get; set; } + public string unit { get; set; } + public decimal? unit_price { get; set; } + public decimal? total_amount { get; set; } + } +} \ No newline at end of file diff --git a/bin/Debug/netcoreapp3.1/rmutr_report.dll b/bin/Debug/netcoreapp3.1/rmutr_report.dll index eb0bc83..1f49ea1 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 e0f9e1b..87410ac 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/netcoreapp3.1/rmutr_report.dll b/obj/Debug/netcoreapp3.1/rmutr_report.dll index eb0bc83..1f49ea1 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 e0f9e1b..87410ac 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.model.nuget.info b/obj/rider.project.model.nuget.info index 08858c1..71f686f 100644 --- a/obj/rider.project.model.nuget.info +++ b/obj/rider.project.model.nuget.info @@ -1 +1 @@ -17006398170547166 \ No newline at end of file +17007343045432872 \ No newline at end of file diff --git a/obj/rider.project.restore.info b/obj/rider.project.restore.info index 81a113f..71f686f 100644 --- a/obj/rider.project.restore.info +++ b/obj/rider.project.restore.info @@ -1 +1 @@ -17006550334815667 \ No newline at end of file +17007343045432872 \ No newline at end of file diff --git a/wwwroot/reports/calculate_meeting_expenses.frx b/wwwroot/reports/calculate_meeting_expenses.frx index 95b5c06..d848bc1 100644 --- a/wwwroot/reports/calculate_meeting_expenses.frx +++ b/wwwroot/reports/calculate_meeting_expenses.frx @@ -1,5 +1,5 @@  - + @@ -96,31 +96,56 @@ - + + + + + + - + + + + + + - + + + + + + - + + + + + + + + + + + diff --git a/wwwroot/reports/land_rent.frx b/wwwroot/reports/land_rent.frx new file mode 100644 index 0000000..7837a75 --- /dev/null +++ b/wwwroot/reports/land_rent.frx @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wwwroot/reports/plant_genetic_conservation_project.frx b/wwwroot/reports/plant_genetic_conservation_project.frx index 50162bf..78e28b0 100644 --- a/wwwroot/reports/plant_genetic_conservation_project.frx +++ b/wwwroot/reports/plant_genetic_conservation_project.frx @@ -1,5 +1,5 @@  - + @@ -327,26 +327,26 @@ - - + + - + - + - - + + - - + + - + @@ -359,10 +359,10 @@ - + - + @@ -371,12 +371,12 @@ - + - + @@ -388,36 +388,36 @@ - + - - - - + + + + - + - + - + - + - + - + - + - + @@ -457,11 +457,11 @@ - + - + - + @@ -472,11 +472,11 @@ - + - + - + @@ -486,9 +486,9 @@ - + - + @@ -503,12 +503,12 @@ - + - + @@ -523,7 +523,7 @@ - + @@ -550,12 +550,12 @@ - - + + - - + + @@ -570,7 +570,7 @@ - + @@ -608,7 +608,7 @@ - + @@ -625,7 +625,7 @@ - + @@ -640,7 +640,7 @@ - + @@ -677,7 +677,7 @@ - + @@ -694,7 +694,7 @@ - + @@ -709,7 +709,7 @@ - + @@ -731,7 +731,7 @@ - + @@ -748,7 +748,7 @@ - + @@ -763,7 +763,7 @@ - + @@ -785,7 +785,7 @@ - + @@ -802,7 +802,7 @@ - + @@ -817,7 +817,7 @@ - + @@ -839,7 +839,7 @@ - + @@ -856,7 +856,7 @@ - + @@ -871,7 +871,7 @@ - + @@ -888,7 +888,7 @@ - + @@ -920,11 +920,11 @@ - + - + @@ -970,7 +970,7 @@ - + @@ -1003,13 +1003,13 @@ - + - + - + @@ -1041,11 +1041,10 @@ - + - - - + + diff --git a/wwwroot/reports/project_principle_rationale_1.frx b/wwwroot/reports/project_principle_rationale_1.frx index 7fb2e03..dfc7699 100644 --- a/wwwroot/reports/project_principle_rationale_1.frx +++ b/wwwroot/reports/project_principle_rationale_1.frx @@ -1,5 +1,5 @@  - + @@ -307,7 +307,7 @@ - + @@ -322,20 +322,21 @@ - - - - + + + + - - - - - + + + + + + - + @@ -346,83 +347,83 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -438,7 +439,7 @@ - + @@ -453,7 +454,7 @@ - + @@ -473,13 +474,13 @@ - + - + - + - + @@ -490,11 +491,11 @@ - + - + - + @@ -503,11 +504,11 @@ - + - + @@ -515,14 +516,14 @@ - - + + - + - + @@ -546,7 +547,7 @@ - + @@ -561,14 +562,14 @@ - + - + - + @@ -592,7 +593,7 @@ - + @@ -609,9 +610,9 @@ - + - + @@ -633,7 +634,7 @@ - + @@ -650,9 +651,9 @@ - + - + @@ -674,7 +675,7 @@ - + @@ -691,9 +692,9 @@ - + - + @@ -715,7 +716,7 @@ - + @@ -732,7 +733,7 @@ - + @@ -747,7 +748,7 @@ - + @@ -875,8 +876,8 @@ - - + + @@ -884,22 +885,17 @@ - + - - - - - - - + + - + - + - + @@ -943,7 +939,7 @@ - + diff --git a/wwwroot/reports/project_request_thailands.frx b/wwwroot/reports/project_request_thailands.frx index 9e1008f..420e084 100644 --- a/wwwroot/reports/project_request_thailands.frx +++ b/wwwroot/reports/project_request_thailands.frx @@ -1,5 +1,5 @@  - + @@ -327,21 +327,21 @@ - + - + - + - + - + @@ -364,14 +364,14 @@ - + - - - + + + - + @@ -384,13 +384,13 @@ - + - + - + @@ -398,17 +398,17 @@ - + - + - + - + @@ -960,7 +960,7 @@ - + @@ -993,13 +993,13 @@ - + - + - - + + @@ -1036,11 +1036,11 @@ - - + + - + @@ -1058,7 +1058,7 @@ - + @@ -1071,7 +1071,7 @@ - + @@ -1089,7 +1089,7 @@ - +