diff --git a/Controllers/RoFive.Controller.cs b/Controllers/RoFive.Controller.cs index a2e6394..5dfc963 100644 --- a/Controllers/RoFive.Controller.cs +++ b/Controllers/RoFive.Controller.cs @@ -646,7 +646,7 @@ namespace rmutr_report.Controllers [HttpPost, Route("reports/revenue_estimate_register_credits/{type}")] [ApiExplorerSettings(GroupName = "reports")] - public IActionResult GetDetailKpiReport([FromRoute] string type, + public IActionResult GetRegisterCreditsReport([FromRoute] string type, [FromBody] revenue_estimate_register_credits revenueEstimate) { var workbook = new XLWorkbook(); @@ -4049,5 +4049,215 @@ namespace rmutr_report.Controllers "revenueEstimate_register" + ".xlsx"); } } + [HttpPost, Route("reports/form_1_2/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetForm2Report([FromRoute] string type, + [FromBody] form_1_2 form1) + { + form1.dates = form1.date.Value.ToString("dd MMMM yyyy", CultureInfo.CreateSpecificCulture("th-TH")); + form1.day_start_workings = form1.start_working.Value.ToString("dd", CultureInfo.CreateSpecificCulture("th-TH")); + form1.month_start_workings = form1.start_working.Value.ToString("MMMM", CultureInfo.CreateSpecificCulture("th-TH")); + form1.year_start_workings = form1.start_working.Value.ToString("yyyy", CultureInfo.CreateSpecificCulture("th-TH")); + var form_1 = new List() { form1 }; + + Report report = new Report(); + report.Load(_setting.report_path + "change_position_offer_request_form.frx"); + report.RegisterData(form_1, "form_1_2"); + 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 "doc": + Word2007Export word = new Word2007Export(); + report.Export(word, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "appllication/vnd.ms-word"); + case "docx": + Word2007Export word1 = new Word2007Export(); + report.Export(word1, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "appllication/vnd.ms-word"); + case "xlsx": + Excel2007Export excel = new Excel2007Export(); + report.Export(excel, stream); + stream.Seek(0, SeekOrigin.Begin); + + return File( + stream, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + "change_position_offer_request_form" + ".xlsx"); + } + + return Ok(); + } + [HttpPost, Route("reports/form_1_3/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetForm3Report([FromRoute] string type, + [FromBody] form_1_3 form3) + { + form3.dates = form3.date.Value.ToString("dd MMMM yyyy", CultureInfo.CreateSpecificCulture("th-TH")); + if (form3.checkbox_1 == true) + { + form3.checkbox1 = "/"; + form3.checkbox2 = null; + form3.checkbox3 = null; + form3.checkbox4 = null; + form3.checkbox5 = null; + } + + if (form3.checkbox_1 ==false ) + { + form3.checkbox1 = null; + } + if (form3.checkbox_2 == true) + { + form3.checkbox2 = "/"; + form3.checkbox1 = null; + form3.checkbox3 = null; + form3.checkbox4 = null; + form3.checkbox5 = null; + } + + if (form3.checkbox_2 ==false ) + { + form3.checkbox2 = null; + } + if (form3.checkbox_3 == true) + { + form3.checkbox3 = "/"; + form3.checkbox2 = null; + form3.checkbox1 = null; + form3.checkbox4 = null; + form3.checkbox5 = null; + } + + if (form3.checkbox_3 ==false ) + { + form3.checkbox3 = null; + } + if (form3.checkbox_4 == true) + { + form3.checkbox4 = "/"; + form3.checkbox2 = null; + form3.checkbox3 = null; + form3.checkbox1 = null; + form3.checkbox5 = null; + } + + if (form3.checkbox_4 ==false ) + { + form3.checkbox4 = null; + } + if (form3.checkbox_5 == true) + { + form3.checkbox5 = "/"; + form3.checkbox2 = null; + form3.checkbox3 = null; + form3.checkbox4 = null; + form3.checkbox1 = null; + } + + if (form3.checkbox_5 ==false ) + { + form3.checkbox5 = null; + } + + if (form3.other_remark!=null||form3.other_remark!="") + { + form3.checkbox6 = "/"; + } + if (form3.other_remark==null||form3.other_remark=="") + { + form3.checkbox6 = null; + } + + if (form3.form_1_3_details != null) + { + foreach (var detail in form3.form_1_3_details) + { + detail.order_dates = + detail.order_date.Value.ToString("dd MMMM yyyy", CultureInfo.CreateSpecificCulture("th-TH")); + detail.Informations_as_of = + detail.Information_as_of.Value.ToString("dd MMMM yyyy", + CultureInfo.CreateSpecificCulture("th-TH")); + if (detail.checkbox_1 == true) + { + detail.checkbox1 = "/"; + detail.checkbox2 = null; + + } + + if (detail.checkbox_1 ==false ) + { + detail.checkbox1 = null; + } + if (detail.checkbox_2 == true) + { + detail.checkbox2 = "/"; + detail.checkbox1 = null; + + } + + if (detail.checkbox_2 ==false ) + { + detail.checkbox2 = null; + } + var a = detail.effects_if; + var b = detail.workload; + foreach (var aa in a) + { + detail.effects_if1 = aa; + } + foreach (var bb in b) + { + detail.workloads = bb; + } + } + } + + var form_3 = new List() { form3 }; + + Report report = new Report(); + report.Load(_setting.report_path + "new_rate_offer_request_form.frx"); + report.RegisterData(form_3, "form_1_3"); + 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 "doc": + Word2007Export word = new Word2007Export(); + report.Export(word, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "appllication/vnd.ms-word"); + case "docx": + Word2007Export word1 = new Word2007Export(); + report.Export(word1, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "appllication/vnd.ms-word"); + case "xlsx": + Excel2007Export excel = new Excel2007Export(); + report.Export(excel, stream); + stream.Seek(0, SeekOrigin.Begin); + + return File( + stream, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + "change_position_offer_request_form" + ".xlsx"); + } + + return Ok(); + } } } \ No newline at end of file diff --git a/Models/RoReport/form_1_2.cs b/Models/RoReport/form_1_2.cs new file mode 100644 index 0000000..f3e1200 --- /dev/null +++ b/Models/RoReport/form_1_2.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace rmutr_report.Models.RoThree +{ + public class form_1_2 + { + [Key] public Guid? form_1_2_uid { get; set; } + public string no { get; set; } + + public DateTime? date { get; set; } + public string dates { get; set; } + +// + public string subject { get; set; } + // + + public string dear { get; set; } + + // + public string first_name_th { get; set; } + + public string last_name_th { get; set; } + + // + public string position_no { get; set; } + + public string position { get; set; } + + // + public string agency_name_th { get; set; } + + public string agency_category_name { get; set; } + + // + public DateTime? start_working { get; set; } + public string day_start_workings { get; set; } + public string month_start_workings { get; set; } + public string year_start_workings { get; set; } + public string year_working { get; set; } + + public string year_month { get; set; } + + // + public string wish { get; set; } + + // + public string old_position { get; set; } + + public string qualification { get; set; } + + // + public decimal? salary { get; set; } + + public string new_position { get; set; } + // + public List form_1_2_images { get; set; } + public List form_1_2_images_2 { get; set; } + } + + public class t_form_1_2_images + { + [Key] public Guid? form_1_2_images_uid { get; set; } + public Guid? form_1_2_uid { get; set; } + public string url { get; set; } + public string file_name { get; set; } + + + public int? row { get; set; } + } + + public class t_form_1_2_images_2 + { + [Key] public Guid? form_1_2_images_2_uid { get; set; } + public Guid? form_1_2_uid { get; set; } + public string url { get; set; } + public string file_name { get; set; } + + public int? row { get; set; } + } +} \ No newline at end of file diff --git a/Models/RoReport/form_1_3.cs b/Models/RoReport/form_1_3.cs new file mode 100644 index 0000000..846522d --- /dev/null +++ b/Models/RoReport/form_1_3.cs @@ -0,0 +1,139 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace rmutr_report.Models.RoThree +{ + public class form_1_3 + { + [Key] public Guid? form_1_3_uid { get; set; } + public string no { get; set; } + + public DateTime? date { get; set; } + public string dates { get; set; } + +// + public string subject { get; set; } + // + + public string dear { get; set; } + + // + public string agency_name_th { get; set; } + +// + public string offer_rate { get; set; } + + // + public bool? checkbox_1 { get; set; } + public bool? checkbox_2 { get; set; } + public bool? checkbox_3 { get; set; } + public bool? checkbox_4 { get; set; } + + public bool? checkbox_5 { get; set; } + + public string checkbox1 { get; set; } + public string checkbox2 { get; set; } + public string checkbox3 { get; set; } + public string checkbox4 { get; set; } + + public string checkbox5 { get; set; } + public string checkbox6 { get; set; } + +// + public string other_remark { get; set; } + + // + public string offer_position { get; set; } + public string offer_qualification { get; set; } + + public decimal? offer_quantity { get; set; } + // + + public decimal? salary_rate { get; set; } + public decimal? currently_exists { get; set; } + + // + public string another_document_remark { get; set; } + public List form_1_3_details { get; set; } + } + + public class t_form_1_3_detail + { + [Key] public Guid? form_1_3_detail_uid { get; set; } + public Guid? form_1_3_uid { get; set; } + + public string no { get; set; } + + // + public string offer_position { get; set; } + public string offer_qualification { get; set; } + + // + public decimal? retirement { get; set; } + + // + public decimal? position_retirement { get; set; } + + // + public decimal? year_retirement { get; set; } + + // + public bool? checkbox_1 { get; set; } + + // + public bool? checkbox_2 { get; set; } + public string checkbox1 { get; set; } + public string checkbox2 { get; set; } + + public string hire_retirees_no { get; set; } + + // + public string hire_qualification { get; set; } + + public string hire_expertise { get; set; } + + // + public string dictation { get; set; } + + // + public string at_1 { get; set; } + + public string at_2 { get; set; } + + // + public string subject { get; set; } + + public DateTime? order_date { get; set; } + public string order_dates { get; set; } + + // + public DateTime? Information_as_of { get; set; } + public string Informations_as_of { get; set; } + + // + public string reason_and_necessity { get; set; } + + // + public List effects_if { get; set; } + public string effects_if1 { get; set; } + + // + public List workload { get; set; } + public string workloads { get; set; } + + // + public int? row { get; set; } + public List files { get; set; } + } + + public class t_form_1_3_files + { + [Key] public Guid? form_1_3_files_uid { get; set; } + public Guid? form_1_3_detail_uid { get; set; } + public string url { get; set; } + public string file_name { get; set; } + public string type { get; set; } + public int? row { 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 dd39de9..ca4fb1b 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 46df7be..ad89a64 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.csproj.CoreCompileInputs.cache b/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache index 344c763..21178a4 100644 --- a/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache +++ b/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -78da8d1f09865b4dbb055f9d21ffa040046ab4d4 +e1adc8339732b993dc1452d09fe96dbe573c273d diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.dll b/obj/Debug/netcoreapp3.1/rmutr_report.dll index dd39de9..ca4fb1b 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 46df7be..ad89a64 100644 Binary files a/obj/Debug/netcoreapp3.1/rmutr_report.pdb and b/obj/Debug/netcoreapp3.1/rmutr_report.pdb differ diff --git a/wwwroot/reports/change_position_offer_request_form.frx b/wwwroot/reports/change_position_offer_request_form.frx new file mode 100644 index 0000000..1acf4f4 --- /dev/null +++ b/wwwroot/reports/change_position_offer_request_form.frx @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wwwroot/reports/new_rate_offer_request_form.frx b/wwwroot/reports/new_rate_offer_request_form.frx new file mode 100644 index 0000000..2e57897 --- /dev/null +++ b/wwwroot/reports/new_rate_offer_request_form.frx @@ -0,0 +1,229 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +