diff --git a/Controllers/PlantGeneticConservationProject.Controller.cs b/Controllers/PlantGeneticConservationProject.Controller.cs new file mode 100644 index 0000000..7f6776a --- /dev/null +++ b/Controllers/PlantGeneticConservationProject.Controller.cs @@ -0,0 +1,93 @@ +using System.Collections.Generic; +using System.IO; +using ClosedXML.Excel; +using FastReport; +using FastReport.Export.Csv; +using FastReport.Export.Mht; +using FastReport.Export.OoXML; +using FastReport.Export.Pdf; +using Microsoft.AspNetCore.Mvc; +using rmutr_report.Models; +using Swashbuckle.AspNetCore.Annotations; + +namespace rmutr_report.Controllers +{ + [SwaggerTag("สำหรับรายงานคำขอโครงการพันธุกรรมพืช ง.5-2.1")] + public class plant_genetic_conservation_project: Controller + { + readonly Setting _setting; + + public plant_genetic_conservation_project(Setting setting) + { + this._setting = setting; + } + [HttpPost, Route("reports/plant_genetic_conservation_project/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetConservationProjectReport([FromRoute] string type, [FromBody] conservation_project project) + { + + foreach (var v in project.five) + { + string na = "ประเด็นยุทธศาสตร์ที่ " ; + v.strategic_issues = na + v.strategic_issues; + string na2 = "กลยุทธ์ที่ " ; + v.measure = na2 + v.measure; + } + foreach (var v in project.eleventh) + { + foreach (var vv in v.elevenths) + { + + 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 + " วัน"; + // } + } + } + + var _project = new List() {project}; + + Report report = new Report(); + report.Load(_setting.report_path + "plant_genetic_conservation_project.frx"); + report.RegisterData(_project, "conservation_project"); + 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; + } + + return Ok(); + } + + } +} \ No newline at end of file diff --git a/Models/budget/conservation_project.cs b/Models/budget/conservation_project.cs new file mode 100644 index 0000000..a186305 --- /dev/null +++ b/Models/budget/conservation_project.cs @@ -0,0 +1,380 @@ +using System.Collections.Generic; + +namespace rmutr_report.Models +{ + public class conservation_project + { + public string product { get; set; } + public string project { get; set; } + public string faculty { get; set; } + public string project_name { get; set; } + public List activity { get; set; } + public string project_activitie { get; set; } //ข้อ 2 + public string principles_reasons { get; set; } //ข้อ 3 + public string objective { get; set; } //ข้อ 4 + public List five { get; set; } //ข้อ 5 + public string strategic_issues { get; set; } //ข้อ 6 + public string subject { get; set; } //ข้อ 6 + public string strategy { get; set; } //ข้อ 6 + public string consistency_ministry { get; set; } //ข้อ 7 + public string consistency_agency { get; set; } //ข้อ 8 + public List ninth { get; set; } //ข้อ 9 + public List tenth { get; set; } //ข้อ 10 + // public int? count_day { get; set; } //ข้อ 11 + // public string text3 { get; set; } //ข้อ 11 + public List eleventh { get; set; } //ข้อ 11 + public string count_activity { get; set; } //ข้อ 12 + public List twelfth { get; set; } //ข้อ 12 + public List twelfths { get; set; } //ข้อ 12 detail ตาราง + public List thirteenth { get; set; } //ข้อ 13 + //public List thirteenth1 { get; set; } //ข้อ 13 + public decimal? durable_articles { get; set; } //งบลงทุน + public decimal? land_building { get; set; } //งบลงทุน + public string url_file1 { get; set; } //งบลงทุน + public string url_file2 { get; set; } //งบลงทุน + public List fourteenth { get; set; }//ข้อ 14 + public string operational_activitie { get; set; }//ข้อ 15 + public string evaluation { get; set; }//ข้อ 16 + public decimal? budget_amount { get; set; } //ข้อ 17 + public List seventeenth{ get; set; } //ข้อ 17 + public List eighteenth { get; set; } //ข้อ 18 + public List nineteenth { get; set; } //ข้อ 19 + public List twentieth { get; set; } //ข้อ 20 + public List twenty_one { get; set; } //ข้อ 21 + public List twenty_two { get; set; } //ข้อ 22 + public string url_file3 { get; set; } //ข้อ 23 + } + + public class activitys_data + { + public string activity { get; set; } + } + + public class five_data + { + public string strategic_issues { get; set; } + public string measure { get; set; } + } + + public class ninths_data + { + public string activity { get; set; } + public string text1 { get; set; } + public string text2 { get; set; } + public string text3 { get; set; } + public string text4 { get; set; } + public string text5 { get; set; } + public string text6 { get; set; } + public string responsible_person { get; set; } + public string agency { get; set; } + public string area { get; set; } + public string telephone_number { get; set; } + public string mobile_number { get; set; } + public string email { get; set; } + } + + public class tenths_data + { + public string activity { get; set; } + public List tenths { get; set; } + } + + public class tenths_data_detail + { + public string the_time { get; set; } + public List tenths2 { get; set; } + } + + public class tenths_data_details + { + public string internal_external1 { get; set; } + public string area_province1 { get; set; } + public string location1 { get; set; } + public string internal_external2 { get; set; } + public string area_province2 { get; set; } + public string location2 { get; set; } + } + + public class eleventh_data + { + public string activity { get; set; } + public List elevenths { get; set; } + } + public class eleventh_data_detail + { + public string the_time { get; set; } + public string count_day { get; set; } + public string start_date { get; set; } + public string end_date { get; set; } + } + + public class twelfth_data + { + public string activity { get; set; } + } + public class twelfth_data_detail + { + public string activity_table { get; set; } + public List twelfths2 { get; set; } + + } + + public class twelfth_data_detail_details + { + public decimal? salaya_executive { get; set; } + public decimal? bophitphimuk_executive { get; set; } + public decimal? pohchang_executive { get; set; } + public decimal? klai_kangwon_executive { get; set; } + public decimal? salaya_teacher { get; set; } + public decimal? bophitphimuk_teacher { get; set; } + public decimal? pohchang_teacher { get; set; } + public decimal? klai_kangwon_teacher { get; set; } + public decimal? salaya_officer { get; set; } + public decimal? bophitphimuk_officer { get; set; } + public decimal? pohchang_officer { get; set; } + public decimal? klai_kangwon_officer { get; set; } + public decimal? salaya_internal_student { get; set; } + public decimal? bophitphimuk_internal_student { get; set; } + public decimal? pohchang_internal_student { get; set; } + public decimal? klai_kangwon_internal_student { get; set; } + public decimal? salaya_external_student{ get; set; } + public decimal? bophitphimuk_external_student { get; set; } + public decimal? pohchang_external_student { get; set; } + public decimal? klai_kangwon_external_student { get; set; } + public decimal? salaya_person { get; set; } + public decimal? bophitphimuk_person { get; set; } + public decimal? pohchang_person{ get; set; } + public decimal? klai_kangwon_person { get; set; } + public decimal? salaya_lecturer { get; set; } + public decimal? bophitphimuk_lecturer { get; set; } + public decimal? pohchang_lecturer { get; set; } + public decimal? klai_kangwon_lecturer{ get; set; } + + public decimal? salaya_board { get; set; } + public decimal? bophitphimuk_board { get; set; } + public decimal? pohchang_board { get; set; } + public decimal? klai_kangwon_board { get; set; } + + public decimal? salaya_driver { get; set; } + public decimal? bophitphimuk_driver { get; set; } + public decimal? pohchang_driver { get; set; } + public decimal? klai_kangwon_driver{ get; set; } + + public decimal? salaya_other { get; set; } + public decimal? bophitphimuk_other { get; set; } + public decimal? pohchang_other { get; set; } + public decimal? klai_kangwon_other { get; set; } + + public decimal? salaya_total { get; set; } + public decimal? bophitphimuk_total { get; set; } + public decimal? pohchang_total { get; set; } + public decimal? klai_kangwon_total { get; set; } + } + + // public class thirteenth_data1 + // { + // public string text1 { get; set; } + // public string text2 { get; set; } + // public string text3 { get; set; } + // public decimal? total_compensation { get; set; } + // public decimal? total_expenses { get; set; } + // public decimal? total_material { get; set; } + // } + public class thirteenth_data + { + public decimal? budget_total_amount { get; set; } + //public string text { get; set; } + //public decimal? total { get; set; } + //public decimal? total_expenses { get; set; } + //public decimal? total_material { get; set; } + //public string activity { get; set; } + //public decimal? budget_amount { get; set; } + public decimal? compensation { get; set; } + public decimal? expenses { get; set; } + public decimal? material { get; set; } + public string text1 { get; set; } + public string text2 { get; set; } + public string text3 { get; set; } + public decimal? total_compensation { get; set; } + public decimal? total_expenses { get; set; } + public decimal? total_material { get; set; } + + public List thirteenth_data_header { get; set; } + } + + public class thirteenth_data_headers + { + public string text4 { get; set; } + public decimal? budget_amount { get; set; } + public string activity { get; set; } + public List thirteenths_compensation { get; set; } + public List thirteenths_expenses { get; set; } + public List thirteenths_material { get; set; } + } + + public class thirteenth_data_detail + { + public string header_name { get; set; } + public decimal? amount { get; set; } + public List thirteenths2_compensation { get; set; } + } + + public class thirteenth_data_details + { + public string name { get; set; } + public decimal? hour { get; set; } + public decimal? amount { get; set; } + public decimal? count_person { get; set; } + public decimal? total_amount { get; set; } + } + public class thirteenth_data_detail2 + { + public string header_name1 { get; set; } + public decimal? amount { get; set; } + public string header_name2 { get; set; } + //public string header_name3 { get; set; } + public List thirteenths_expenses1 { get; set; } + public List thirteenths_expenses2 { get; set; } + public List thirteenths_expenses3 { get; set; } + } + + public class thirteenth2_data_details + { + public string name { get; set; } + public decimal? amount { get; set; } + public decimal? count_person { get; set; } + public decimal? total_amount { get; set; } + } + + public class thirteenth2_data_details2 + { + public string name { get; set; } + public decimal? amount { get; set; } + public decimal? day { get; set; } + public decimal? count_person { get; set; } + public decimal? total_amount { get; set; } + } + public class thirteenth2_data_details3 + { + + public string header_name3 { get; set; } + public List thirteenths_expenses3_details { get; set; } + + + } + + public class thirteenths_expenses3_detail + { + public string name { get; set; } + public decimal? amount { get; set; } + public decimal? potion { get; set; } + public decimal? count_person { get; set; } + public decimal? total_amount { get; set; } + } + + public class thirteenth_data_detail3 + { + + public decimal? amount { get; set; } + public List thirteenths2_material { get; set; } + + } + + public class thirteenth_data_materials + { + public string name { get; set; } + public string unit { get; set; } + public decimal? amount { get; set; } + public decimal? unit_price { get; set; } + public decimal? total_amount { get; set; } + } + + public class fourteenths_data + { + public string side { get; set; } + } + + public class seventeenths_data + { + public string action_plan { get; set; } + public string month_1 { get; set; } + public string month_2 { get; set; } + public string month_3 { get; set; } + public string month_4 { get; set; } + public string month_5 { get; set; } + public string month_6 { get; set; } + public string month_7 { get; set; } + public string month_8 { get; set; } + public string month_9 { get; set; } + public string month_10 { get; set; } + public string month_11 { get; set; } + public string month_12 { get; set; } + } + + public class eighteenths_data + { + public string text1 { get; set; } + public string text2 { get; set; } + public string text3 { get; set; } + public string text4 { get; set; } + public string text5 { get; set; } + public string text6 { get; set; } + public string text7 { get; set; } + public string text8 { get; set; } + // public string text9 { get; set; } + // public string text10 { get; set; } + public string bath { get; set; } + public string nuai_nap { get; set; } + public string khrang1 { get; set; } + public string khrang2 { get; set; } + public string khrang3 { get; set; } + public string rueang { get; set; } + public string activity { get; set; } + public string clause1 { get; set; } + public string count_quantitative { get; set; } + public string count_unit { get; set; } + public string count_project { get; set; } + public string count_training { get; set; } + public string count_knowledge { get; set; } + public string clause2 { get; set; } + public string project_start_date { get; set; } + public string project_end_date { get; set; } + public string percentage_finish { get; set; } + public string clause3 { get; set; } + public string percentage1 { get; set; } + public string percentage2 { get; set; } + public string target { get; set; } + public string results { get; set; } + public string clause4 { get; set; } + public decimal? expenses { get; set; } + } + + public class nineteenths_data + { + public string type_project { get; set; } + } + + public class twentieths_data + { + public string target { get; set; } + public string positive { get; set; } + public string negative { get; set; } + } + + public class twentys_two_data + { + public string activity { get; set; } + public string activity_display_name { get; set; } + public string dates { get; set; } + public string location { get; set; } + public List twenty_two_data_detail { get; set; } + } + + public class twentys_two_data_details + { + public string dates { get; set; } + public string times { get; set; } + public string detail { get; set; } + public string lecturer { get; set; } + } +} \ No newline at end of file diff --git a/wwwroot/reports/plant_genetic_conservation_project.frx b/wwwroot/reports/plant_genetic_conservation_project.frx new file mode 100644 index 0000000..5138fb2 --- /dev/null +++ b/wwwroot/reports/plant_genetic_conservation_project.frx @@ -0,0 +1,1031 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wwwroot/reports/project_principle_rationale.frx b/wwwroot/reports/project_principle_rationale.frx index 14c598d..d51fbfd 100644 --- a/wwwroot/reports/project_principle_rationale.frx +++ b/wwwroot/reports/project_principle_rationale.frx @@ -1,5 +1,5 @@  - + @@ -81,6 +81,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -276,12 +308,12 @@ - - + + - + @@ -305,11 +337,11 @@ - + - + @@ -320,84 +352,84 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -413,7 +445,8 @@ - + + @@ -429,86 +462,85 @@ - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - + - + - + - + @@ -519,11 +551,11 @@ - + - + - + @@ -532,11 +564,11 @@ - + - + @@ -544,14 +576,14 @@ - - + + - + - + @@ -575,7 +607,7 @@ - + @@ -590,14 +622,14 @@ - + - + - + @@ -621,7 +653,7 @@ - + @@ -638,9 +670,9 @@ - + - + @@ -662,7 +694,7 @@ - + @@ -679,9 +711,9 @@ - + - + @@ -703,7 +735,7 @@ - + @@ -720,7 +752,7 @@ - + @@ -735,7 +767,7 @@ - +