diff --git a/Controllers/RoFive.Controller.cs b/Controllers/RoFive.Controller.cs index 05ce28b..0013f15 100644 --- a/Controllers/RoFive.Controller.cs +++ b/Controllers/RoFive.Controller.cs @@ -4282,6 +4282,65 @@ namespace rmutr_report.Controllers "change_position_offer_request_form" + ".xlsx"); } + return Ok(); + } + [HttpPost, Route("reports/budget_income_qualification/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetForm1Report([FromRoute] string type, + [FromBody] form_1_1 form1) + { + if (form1.budget_income_qualification_date!=null) + { + form1.budget_income_qualification_dates = form1.budget_income_qualification_date.Value.ToString("dd MMMM yyyy", CultureInfo.CreateSpecificCulture("th-TH")); + + } + + if (form1.budget_project_date != null) + { + form1.day_budget_project = + form1.budget_project_date.Value.ToString("dd", CultureInfo.CreateSpecificCulture("th-TH")); + form1.month_budget_project = + form1.budget_project_date.Value.ToString("MMMM", CultureInfo.CreateSpecificCulture("th-TH")); + form1.year_budget_project = + form1.budget_project_date.Value.ToString("yyyy", CultureInfo.CreateSpecificCulture("th-TH")); + } + + var form_1 = new List() { form1 }; + + Report report = new Report(); + report.Load(_setting.report_path + "qualifications_offer_request_form.frx"); + report.RegisterData(form_1, "form_1_1"); + 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", + "budget_income_qualification" + ".xlsx"); + } + return Ok(); } } diff --git a/Models/RoReport/form_1_1.cs b/Models/RoReport/form_1_1.cs new file mode 100644 index 0000000..15f1fca --- /dev/null +++ b/Models/RoReport/form_1_1.cs @@ -0,0 +1,50 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace rmutr_report.Models.RoThree +{ + public class form_1_1 + { + [Key] public Guid? budget_income_qualification_uid { get; set; } + public Guid? budget_year_uid { get; set; } + public int? budget_income_qualification_no { get; set; } + public DateTime? budget_income_qualification_date { get; set; } + public string budget_income_qualification_dates { get; set; } + public string budget_income_qualification_topic { get; set; } + public string budget_income_qualification_dear { get; set; } + public string first_name { get; set; } + public string last_name { get; set; } + public string position_no { get; set; } + public string position_name { get; set; } + public Guid? agency_uid { get; set; } + public Guid? budget_plan_uid { get; set; } + public Guid? budget_project_uid { get; set; } + // + public string college_faculty_name_th { get; set; } + public string budget_project_name_th { get; set; } + + public DateTime? budget_project_date { get; set; } + public string day_budget_project { get; set; } + public string month_budget_project { get; set; } + public string year_budget_project { get; set; } + public int? budget_project_time_year { get; set; } + public int? budget_project_time_month { get; set; } + public string due_to { get; set; } //เนื่องจาก + public Guid? current_position_uid { get; set; } + public Guid? new_position_uid { get; set; } + public Guid? current_qualification_uid { get; set; } + public Guid? new_qualification_uid { get; set; } + // + public string current_position { get; set; } + public string new_position { get; set; } + public string current_qualification { get; set; } + public string new_qualification { get; set; } + [Column(TypeName ="decimal(18,2)")] + public decimal? current_salary { get; set; } + [Column(TypeName ="decimal(18,2)")] + public decimal? new_salary { get; set; } + public string budget_income_qualification_file_1 { get; set; } + public string budget_income_qualification_file_2 { 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 309d706..f78d976 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 f8f115d..2688c16 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 f3288b1..6085111 100644 --- a/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache +++ b/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -e8c611bef91a50e36027e867bde92a40dbfb783c +11e4fd5a843528ee9b0393d7bdaae5e631b873db diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.dll b/obj/Debug/netcoreapp3.1/rmutr_report.dll index 309d706..f78d976 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 f8f115d..2688c16 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/project.assets.json b/obj/project.assets.json index 1c2e072..13c8c8c 100644 --- a/obj/project.assets.json +++ b/obj/project.assets.json @@ -1,7 +1,7 @@ { "version": 3, "targets": { - ".NETCoreApp,Version=v3.1": { + "net5.0": { "ClosedXML/0.96.0": { "type": "package", "dependencies": { @@ -446,12 +446,12 @@ "Swashbuckle.AspNetCore.SwaggerGen": "6.5.0" }, "compile": { - "lib/netcoreapp3.0/Swashbuckle.AspNetCore.Annotations.dll": { + "lib/net5.0/Swashbuckle.AspNetCore.Annotations.dll": { "related": ".pdb;.xml" } }, "runtime": { - "lib/netcoreapp3.0/Swashbuckle.AspNetCore.Annotations.dll": { + "lib/net5.0/Swashbuckle.AspNetCore.Annotations.dll": { "related": ".pdb;.xml" } } @@ -462,12 +462,12 @@ "Microsoft.OpenApi": "1.2.3" }, "compile": { - "lib/netcoreapp3.0/Swashbuckle.AspNetCore.Swagger.dll": { + "lib/net5.0/Swashbuckle.AspNetCore.Swagger.dll": { "related": ".pdb;.xml" } }, "runtime": { - "lib/netcoreapp3.0/Swashbuckle.AspNetCore.Swagger.dll": { + "lib/net5.0/Swashbuckle.AspNetCore.Swagger.dll": { "related": ".pdb;.xml" } }, @@ -481,12 +481,12 @@ "Swashbuckle.AspNetCore.Swagger": "6.5.0" }, "compile": { - "lib/netcoreapp3.0/Swashbuckle.AspNetCore.SwaggerGen.dll": { + "lib/net5.0/Swashbuckle.AspNetCore.SwaggerGen.dll": { "related": ".pdb;.xml" } }, "runtime": { - "lib/netcoreapp3.0/Swashbuckle.AspNetCore.SwaggerGen.dll": { + "lib/net5.0/Swashbuckle.AspNetCore.SwaggerGen.dll": { "related": ".pdb;.xml" } } @@ -494,12 +494,12 @@ "Swashbuckle.AspNetCore.SwaggerUI/6.5.0": { "type": "package", "compile": { - "lib/netcoreapp3.0/Swashbuckle.AspNetCore.SwaggerUI.dll": { + "lib/net5.0/Swashbuckle.AspNetCore.SwaggerUI.dll": { "related": ".pdb;.xml" } }, "runtime": { - "lib/netcoreapp3.0/Swashbuckle.AspNetCore.SwaggerUI.dll": { + "lib/net5.0/Swashbuckle.AspNetCore.SwaggerUI.dll": { "related": ".pdb;.xml" } }, @@ -2136,7 +2136,7 @@ } }, "projectFileDependencyGroups": { - ".NETCoreApp,Version=v3.1": [ + "net5.0": [ "ClosedXML >= 0.96.0", "FastReport.Core >= 2021.3.0", "Swashbuckle.AspNetCore >= 6.5.0", @@ -2161,15 +2161,15 @@ "C:\\Program Files (x86)\\NuGet\\Config\\nuget.config" ], "originalTargetFrameworks": [ - "netcoreapp3.1" + "net5.0" ], "sources": { "https://api.nuget.org/v3/index.json": {}, "https://nuget.71dev.com/v3/index.json": {} }, "frameworks": { - "netcoreapp3.1": { - "targetAlias": "netcoreapp3.1", + "net5.0": { + "targetAlias": "net5.0", "projectReferences": {} } }, @@ -2180,8 +2180,8 @@ } }, "frameworks": { - "netcoreapp3.1": { - "targetAlias": "netcoreapp3.1", + "net5.0": { + "targetAlias": "net5.0", "dependencies": { "ClosedXML": { "target": "Package", diff --git a/obj/project.nuget.cache b/obj/project.nuget.cache index aca2bc6..fe8f515 100644 --- a/obj/project.nuget.cache +++ b/obj/project.nuget.cache @@ -1,6 +1,6 @@ { "version": 2, - "dgSpecHash": "AcjdXi5x9A0nxsTWB+2PnbaIBtEgf/xXjiH70whPTOKfE3hLR7xlfQsZ/JREuaGE/sSzaWLOjWThFS4rkZ0mog==", + "dgSpecHash": "TgdSlhcNLrmoGcymKBKtBNUewM9z9QdY0FESfevGdFzEBUl5TotP+ysyCZqFpczcvGDJdBKPRCtfqngiN8LZRQ==", "success": true, "projectFilePath": "C:\\Users\\USER\\Documents\\rmutr_report\\rmutr_report.csproj", "expectedPackageFiles": [ diff --git a/obj/project.packagespec.json b/obj/project.packagespec.json index b78619f..daed5e1 100644 --- a/obj/project.packagespec.json +++ b/obj/project.packagespec.json @@ -1 +1 @@ -"restore":{"projectUniqueName":"C:\\Users\\USER\\Documents\\rmutr_report\\rmutr_report.csproj","projectName":"rmutr_report","projectPath":"C:\\Users\\USER\\Documents\\rmutr_report\\rmutr_report.csproj","outputPath":"C:\\Users\\USER\\Documents\\rmutr_report\\obj\\","projectStyle":"PackageReference","originalTargetFrameworks":["netcoreapp3.1"],"sources":{"https://api.nuget.org/v3/index.json":{},"https://nuget.71dev.com/v3/index.json":{}},"frameworks":{"netcoreapp3.1":{"projectReferences":{}}},"warningProperties":{"warnAsError":["NU1605"]}}"frameworks":{"netcoreapp3.1":{"dependencies":{"ClosedXML":{"target":"Package","version":"[0.96.0, )"},"FastReport.Core":{"target":"Package","version":"[2021.3.0, )"},"Swashbuckle.AspNetCore":{"target":"Package","version":"[6.5.0, )"},"Swashbuckle.AspNetCore.Annotations":{"target":"Package","version":"[6.5.0, )"}},"imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"frameworkReferences":{"Microsoft.AspNetCore.App":{"privateAssets":"none"},"Microsoft.NETCore.App":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"C:\\Program Files\\dotnet\\sdk\\6.0.407\\RuntimeIdentifierGraph.json"}} \ No newline at end of file +"restore":{"projectUniqueName":"C:\\Users\\USER\\Documents\\rmutr_report\\rmutr_report.csproj","projectName":"rmutr_report","projectPath":"C:\\Users\\USER\\Documents\\rmutr_report\\rmutr_report.csproj","outputPath":"C:\\Users\\USER\\Documents\\rmutr_report\\obj\\","projectStyle":"PackageReference","originalTargetFrameworks":["net5.0"],"sources":{"https://api.nuget.org/v3/index.json":{},"https://nuget.71dev.com/v3/index.json":{}},"frameworks":{"net5.0":{"projectReferences":{}}},"warningProperties":{"warnAsError":["NU1605"]}}"frameworks":{"net5.0":{"dependencies":{"ClosedXML":{"target":"Package","version":"[0.96.0, )"},"FastReport.Core":{"target":"Package","version":"[2021.3.0, )"},"Swashbuckle.AspNetCore":{"target":"Package","version":"[6.5.0, )"},"Swashbuckle.AspNetCore.Annotations":{"target":"Package","version":"[6.5.0, )"}},"imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"frameworkReferences":{"Microsoft.AspNetCore.App":{"privateAssets":"none"},"Microsoft.NETCore.App":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"C:\\Program Files\\dotnet\\sdk\\6.0.407\\RuntimeIdentifierGraph.json"}} \ No newline at end of file diff --git a/obj/rider.project.restore.info b/obj/rider.project.restore.info index d4e1c0f..8a58dea 100644 --- a/obj/rider.project.restore.info +++ b/obj/rider.project.restore.info @@ -1 +1 @@ -16909729614022267 \ No newline at end of file +16909758902259703 \ No newline at end of file diff --git a/obj/rmutr_report.csproj.nuget.dgspec.json b/obj/rmutr_report.csproj.nuget.dgspec.json index 0d1d259..6a65beb 100644 --- a/obj/rmutr_report.csproj.nuget.dgspec.json +++ b/obj/rmutr_report.csproj.nuget.dgspec.json @@ -19,15 +19,15 @@ "C:\\Program Files (x86)\\NuGet\\Config\\nuget.config" ], "originalTargetFrameworks": [ - "netcoreapp3.1" + "net5.0" ], "sources": { "https://api.nuget.org/v3/index.json": {}, "https://nuget.71dev.com/v3/index.json": {} }, "frameworks": { - "netcoreapp3.1": { - "targetAlias": "netcoreapp3.1", + "net5.0": { + "targetAlias": "net5.0", "projectReferences": {} } }, @@ -38,8 +38,8 @@ } }, "frameworks": { - "netcoreapp3.1": { - "targetAlias": "netcoreapp3.1", + "net5.0": { + "targetAlias": "net5.0", "dependencies": { "ClosedXML": { "target": "Package", diff --git a/rmutr_report.csproj b/rmutr_report.csproj index 79cd0c4..1d2b290 100644 --- a/rmutr_report.csproj +++ b/rmutr_report.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net5.0 true diff --git a/wwwroot/reports/qualifications_offer_request_form.frx b/wwwroot/reports/qualifications_offer_request_form.frx index e1831da..bdc6858 100644 --- a/wwwroot/reports/qualifications_offer_request_form.frx +++ b/wwwroot/reports/qualifications_offer_request_form.frx @@ -1,28 +1,31 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -31,24 +34,24 @@ - + - + - + - + - + - + @@ -61,50 +64,50 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -136,7 +139,7 @@ - +