diff --git a/BMA.EHR.Recurit.Exam.Service.csproj b/BMA.EHR.Recurit.Exam.Service.csproj
index c2997b6..eaab20c 100644
--- a/BMA.EHR.Recurit.Exam.Service.csproj
+++ b/BMA.EHR.Recurit.Exam.Service.csproj
@@ -78,6 +78,7 @@
+
diff --git a/Controllers/CMSCandidateController.cs b/Controllers/CMSCandidateController.cs
index 0714855..c9e4d73 100644
--- a/Controllers/CMSCandidateController.cs
+++ b/Controllers/CMSCandidateController.cs
@@ -155,7 +155,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
- public async Task> UpdateBannerAsync(CMSCandidate banner)
+ public async Task> UpdateBannerAsync()
{
try
{
diff --git a/Controllers/DistrictController.cs b/Controllers/DistrictController.cs
deleted file mode 100644
index b77840e..0000000
--- a/Controllers/DistrictController.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-using BMA.EHR.Recurit.Exam.Service.Response;
-using BMA.EHR.Recurit.Exam.Service.Services;
-using Microsoft.AspNetCore.Authorization;
-using Microsoft.AspNetCore.Mvc;
-using Swashbuckle.AspNetCore.Annotations;
-
-namespace BMA.EHR.Recurit.Exam.Service.Controllers
-{
- [Route("api/v{version:apiVersion}/district")]
- [ApiVersion("1.0")]
- [ApiController]
- [Produces("application/json")]
- [Authorize]
- [SwaggerTag("จัดการข้อมูลอำเภอ เพื่อนำไปใช้งานในระบบ")]
- public class DistrictController : BaseController
- {
- #region " Fields "
-
- private readonly DistrictService _districtService;
-
- #endregion
-
- #region " Constructor and Destructor "
-
- public DistrictController(DistrictService districtService)
- {
- _districtService = districtService;
- }
-
- #endregion
-
- #region " Methods "
-
- ///
- /// อ่านข้อมูลจาก Relational Db โดยแสดงเฉพาะข้อมูลที่ Active เท่านั้น
- ///
- /// รหัสจังหวัด
- ///
- /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ
- /// ไม่ได้ Login เข้าระบบ
- /// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpGet("{province:length(36)}")]
- [ProducesResponseType(StatusCodes.Status200OK)]
- [ProducesResponseType(StatusCodes.Status401Unauthorized)]
- [ProducesResponseType(StatusCodes.Status500InternalServerError)]
- public async Task> GetsAsync(string province)
- {
- try
- {
- var items = await _districtService.GetsAsync(provinceId: province, showAll: false);
-
- return Success(items);
- }
- catch (Exception ex)
- {
- return Error(ex);
- }
- }
-
- #endregion
-
- }
-}
\ No newline at end of file
diff --git a/Controllers/EducationLevelController.cs b/Controllers/EducationLevelController.cs
deleted file mode 100644
index e8c0765..0000000
--- a/Controllers/EducationLevelController.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-using BMA.EHR.Recurit.Exam.Service.Response;
-using BMA.EHR.Recurit.Exam.Service.Services;
-using Microsoft.AspNetCore.Authorization;
-using Microsoft.AspNetCore.Mvc;
-using Swashbuckle.AspNetCore.Annotations;
-
-namespace BMA.EHR.Recurit.Exam.Service.Controllers
-{
- [Route("api/v{version:apiVersion}/education-level")]
- [ApiVersion("1.0")]
- [ApiController]
- [Produces("application/json")]
- [Authorize]
- [SwaggerTag("จัดการข้อมูลระดับการศึกษา เพื่อนำไปใช้งานในระบบ")]
- public class EducationLevelController : BaseController
- {
- #region " Fields "
-
- private readonly EducationLevelService _educationLevelService;
-
- #endregion
-
- #region " Constructor and Destructor "
-
- public EducationLevelController(EducationLevelService educationLevelService)
- {
- _educationLevelService = educationLevelService;
- }
-
- #endregion
-
- #region " Methods "
-
- ///
- /// อ่านข้อมูลจาก Relational Db โดยแสดงเฉพาะข้อมูลที่ Active เท่านั้น
- ///
- ///
- /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ
- /// ไม่ได้ Login เข้าระบบ
- /// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpGet]
- [ProducesResponseType(StatusCodes.Status200OK)]
- [ProducesResponseType(StatusCodes.Status401Unauthorized)]
- [ProducesResponseType(StatusCodes.Status500InternalServerError)]
- public async Task> GetsAsync()
- {
- try
- {
- var items = await _educationLevelService.GetsAsync(showAll: false);
-
- return Success(items);
- }
- catch (Exception ex)
- {
- return Error(ex);
- }
- }
-
- #endregion
- }
-}
diff --git a/Controllers/PrefixController.cs b/Controllers/PrefixController.cs
deleted file mode 100644
index bbea613..0000000
--- a/Controllers/PrefixController.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-using BMA.EHR.Recurit.Exam.Service.Response;
-using BMA.EHR.Recurit.Exam.Service.Services;
-using Microsoft.AspNetCore.Authorization;
-using Microsoft.AspNetCore.Mvc;
-using Swashbuckle.AspNetCore.Annotations;
-
-namespace BMA.EHR.Recurit.Exam.Service.Controllers
-{
- [Route("api/v{version:apiVersion}/prefix")]
- [ApiVersion("1.0")]
- [ApiController]
- [Produces("application/json")]
- [Authorize]
- [SwaggerTag("จัดการข้อมูลคำนำหน้า เพื่อนำไปใช้งานในระบบ")]
- public class PrefixController : BaseController
- {
- #region " Fields "
-
- private readonly PrefixService _prefixService;
-
- #endregion
-
- #region " Constructor and Destructor "
-
- public PrefixController(PrefixService prefixService)
- {
- _prefixService = prefixService;
- }
-
- #endregion
-
- #region " Methods "
-
- ///
- /// อ่านข้อมูลจาก Relational Db โดยแสดงเฉพาะ ข้อมูลที่ Active เท่านั้น
- ///
- ///
- /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ
- /// ไม่ได้ Login เข้าระบบ
- /// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpGet]
- [ProducesResponseType(StatusCodes.Status200OK)]
- [ProducesResponseType(StatusCodes.Status401Unauthorized)]
- [ProducesResponseType(StatusCodes.Status500InternalServerError)]
- public async Task> GetsAsync()
- {
- try
- {
- var items = await _prefixService.GetsAsync(showAll: false);
-
- return Success(items);
- }
- catch (Exception ex)
- {
- return Error(ex);
- }
- }
-
- #endregion
- }
-}
diff --git a/Controllers/ProvinceController.cs b/Controllers/ProvinceController.cs
deleted file mode 100644
index dd76d4f..0000000
--- a/Controllers/ProvinceController.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-using BMA.EHR.Recurit.Exam.Service.Response;
-using BMA.EHR.Recurit.Exam.Service.Services;
-using Microsoft.AspNetCore.Authorization;
-using Microsoft.AspNetCore.Mvc;
-using Swashbuckle.AspNetCore.Annotations;
-
-namespace BMA.EHR.Recurit.Exam.Service.Controllers
-{
- [Route("api/v{version:apiVersion}/province")]
- [ApiVersion("1.0")]
- [ApiController]
- [Produces("application/json")]
- [Authorize]
- [SwaggerTag("จัดการข้อมูลจังหวัด เพื่อนำไปใช้งานในระบบ")]
- public class ProvinceController : BaseController
- {
- #region " Fields "
-
- private readonly ProvinceService _provinceService;
-
- #endregion
-
- #region " Constructor and Destructor "
-
- public ProvinceController(ProvinceService provinceService)
- {
- _provinceService = provinceService;
- }
-
- #endregion
-
- #region " Methods "
-
- ///
- /// อ่านข้อมูลจาก Relational Db โดยแสดงเฉพาะข้อมูลที่ Active เท่านั้น
- ///
- ///
- /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ
- /// ไม่ได้ Login เข้าระบบ
- /// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpGet]
- [ProducesResponseType(StatusCodes.Status200OK)]
- [ProducesResponseType(StatusCodes.Status401Unauthorized)]
- [ProducesResponseType(StatusCodes.Status500InternalServerError)]
- public async Task> GetsAsync()
- {
- try
- {
- var items = await _provinceService.GetsAsync(showAll: false);
-
- return Success(items);
- }
- catch (Exception ex)
- {
- return Error(ex);
- }
- }
-
- #endregion
-
- }
-}
\ No newline at end of file
diff --git a/Controllers/RelationshipController.cs b/Controllers/RelationshipController.cs
deleted file mode 100644
index 7810a27..0000000
--- a/Controllers/RelationshipController.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-using BMA.EHR.Recurit.Exam.Service.Response;
-using BMA.EHR.Recurit.Exam.Service.Services;
-using Microsoft.AspNetCore.Authorization;
-using Microsoft.AspNetCore.Mvc;
-using Swashbuckle.AspNetCore.Annotations;
-
-namespace BMA.EHR.Recurit.Exam.Service.Controllers
-{
- [Route("api/v{version:apiVersion}/relationship")]
- [ApiVersion("1.0")]
- [ApiController]
- [Produces("application/json")]
- [Authorize]
- [SwaggerTag("จัดการข้อมูลสถานะภาพ เพื่อนำไปใช้งานในระบบ")]
- public class RelationshipController : BaseController
- {
- #region " Fields "
-
- private readonly RelationshipService _relationshipService;
-
- #endregion
-
- #region " Constructor and Destructor "
-
- public RelationshipController(RelationshipService relationshipService)
- {
- _relationshipService = relationshipService;
- }
-
- #endregion
-
- #region " Methods "
-
- ///
- /// อ่านข้อมูลจาก Relational Db โดยแสดงเฉพาะข้อมูลที่ Active เท่านั้น
- ///
- ///
- /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ
- /// ไม่ได้ Login เข้าระบบ
- /// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpGet]
- [ProducesResponseType(StatusCodes.Status200OK)]
- [ProducesResponseType(StatusCodes.Status401Unauthorized)]
- [ProducesResponseType(StatusCodes.Status500InternalServerError)]
- public async Task> GetsAsync()
- {
- try
- {
- var items = await _relationshipService.GetsAsync(showAll: false);
-
- return Success(items);
- }
- catch (Exception ex)
- {
- return Error(ex);
- }
- }
-
- #endregion
- }
-}
\ No newline at end of file
diff --git a/Controllers/ReligionController.cs b/Controllers/ReligionController.cs
deleted file mode 100644
index 6ccfe4c..0000000
--- a/Controllers/ReligionController.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-using BMA.EHR.Recurit.Exam.Service.Response;
-using BMA.EHR.Recurit.Exam.Service.Services;
-using Microsoft.AspNetCore.Authorization;
-using Microsoft.AspNetCore.Mvc;
-using Swashbuckle.AspNetCore.Annotations;
-
-namespace BMA.EHR.Recurit.Exam.Service.Controllers
-{
- [Route("api/v{version:apiVersion}/religion")]
- [ApiVersion("1.0")]
- [ApiController]
- [Produces("application/json")]
- [Authorize]
- [SwaggerTag("จัดการข้อมูลศาสนา เพื่อนำไปใช้งานในระบบ")]
- public class ReligionController : BaseController
- {
- #region " Fields "
-
- private readonly ReligionService _religionService;
-
- #endregion
-
- #region " Constructor and Destructor "
-
- public ReligionController(ReligionService religionService)
- {
- _religionService = religionService;
- }
-
- #endregion
-
- #region " Methods "
-
- ///
- /// อ่านข้อมูลจาก Relational Db โดยแสดงเฉพาะข้อมูลที่ Active เท่านั้น
- ///
- ///
- /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ
- /// ไม่ได้ Login เข้าระบบ
- /// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpGet]
- [ProducesResponseType(StatusCodes.Status200OK)]
- [ProducesResponseType(StatusCodes.Status401Unauthorized)]
- [ProducesResponseType(StatusCodes.Status500InternalServerError)]
- public async Task> GetsAsync()
- {
- try
- {
- var items = await _religionService.GetsAsync(showAll: false);
-
- return Success(items);
- }
- catch (Exception ex)
- {
- return Error(ex);
- }
- }
-
- #endregion
- }
-}
diff --git a/Controllers/ReportController.cs b/Controllers/ReportController.cs
new file mode 100644
index 0000000..4b54870
--- /dev/null
+++ b/Controllers/ReportController.cs
@@ -0,0 +1,120 @@
+// using BMA.EHR.Recurit.Exam.Service.Core;
+// using BMA.EHR.Recurit.Exam.Service.Data;
+// using BMA.EHR.Recurit.Exam.Service.Models;
+// using BMA.EHR.Recurit.Exam.Service.Request;
+// using BMA.EHR.Recurit.Exam.Service.Response;
+// using BMA.EHR.Recurit.Exam.Service.Services;
+// using Microsoft.AspNetCore.Authorization;
+// using Microsoft.AspNetCore.Mvc;
+// using Microsoft.EntityFrameworkCore;
+// using Swashbuckle.AspNetCore.Annotations;
+// using Telerik.Reporting;
+// using Telerik.Reporting.Processing;
+
+// namespace BMA.EHR.Recurit.Exam.Service.Controllers
+// {
+// [Route("api/v{version:apiVersion}/report")]
+// [ApiVersion("1.0")]
+// [ApiController]
+// [Produces("application/json")]
+// [Authorize]
+// [SwaggerTag("จัดการข้อมูลหน้าเว็บสมัครสอบ เพื่อนำไปใช้งานในระบบ")]
+// public class ReportController : BaseController
+// {
+// #region " Fields "
+
+// private readonly ApplicationDbContext _context;
+// private readonly CMSCandidateService _cmsCandidateService;
+// private readonly IWebHostEnvironment _hostingEnvironment;
+
+// #endregion
+
+// #region " Constructor and Destructor "
+
+// public ReportController(ApplicationDbContext context, CMSCandidateService cmsCandidateService, IWebHostEnvironment hostingEnvironment)
+// {
+// _context = context;
+// _cmsCandidateService = cmsCandidateService;
+// _hostingEnvironment = hostingEnvironment;
+// }
+
+// #endregion
+
+// public static IConfigurationRoot Configuration
+// {
+// get
+// {
+// return new ConfigurationBuilder()
+// .SetBasePath(Directory.GetCurrentDirectory())
+// .AddJsonFile("appsettings.json")
+// .Build();
+// }
+// }
+
+// #region " Methods "
+
+// ///
+// /// ใบเสร็จผู้สมัครสอบ
+// ///
+// /// รหัสใบสมัคร
+// ///
+// /// เมื่อทำการอ่านใบเสร็จผู้สมัครสอบสำเร็จ
+// /// ไม่ได้ Login เข้าระบบ
+// /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+// [HttpGet]
+// [ProducesResponseType(StatusCodes.Status200OK)]
+// [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+// [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+// public async Task> GetsAsync(string candidateId)
+// {
+// try
+// {
+// return Success("ยังใช้ไม่ได้จ้าา");
+// var candidate = await _context.Candidates.AsQueryable()
+// .Where(x => x.Id == Guid.Parse(candidateId))
+// .Select(x => new
+// {
+// Fee = x.PeriodExam == null ? 0 : x.PeriodExam.Fee,
+// // DateBill = DateTime.now,
+// })
+// .FirstOrDefaultAsync();
+
+// if (candidate == null)
+// throw new Exception(GlobalMessages.CandidateNotFound);
+
+// var rptFile = "";
+
+// rptFile = Path.Combine(_hostingEnvironment.ContentRootPath, "Report", "rptBillPayment.trdp");
+// ReportPackager reportPackager = new ReportPackager();
+// Telerik.Reporting.Report? report = null;
+// using (var sourceStream = System.IO.File.OpenRead(rptFile))
+// {
+// report = (Telerik.Reporting.Report)reportPackager.UnpackageDocument(sourceStream);
+// }
+
+// report.DataSource = candidate;
+// System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable();
+
+// InstanceReportSource instanceReportSource = new InstanceReportSource()
+// {
+// ReportDocument = report
+// };
+
+
+// ReportProcessor reportProcessor = new ReportProcessor(Configuration);
+// RenderingResult result = reportProcessor.RenderReport("PDF", instanceReportSource, deviceInfo);
+
+// var outputfile = $"DoctorOrderSheet_.pdf";
+
+// return File(result.DocumentBytes, "application/pdf", outputfile);
+
+// }
+// catch (Exception ex)
+// {
+// return Error(ex);
+// }
+// }
+
+// #endregion
+// }
+// }
diff --git a/Controllers/SubDistrictController.cs b/Controllers/SubDistrictController.cs
deleted file mode 100644
index 22baee1..0000000
--- a/Controllers/SubDistrictController.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-using BMA.EHR.Recurit.Exam.Service.Response;
-using BMA.EHR.Recurit.Exam.Service.Services;
-using Microsoft.AspNetCore.Authorization;
-using Microsoft.AspNetCore.Mvc;
-using Swashbuckle.AspNetCore.Annotations;
-
-namespace BMA.EHR.Recurit.Exam.Service.Controllers
-{
- [Route("api/v{version:apiVersion}/sub-district")]
- [ApiVersion("1.0")]
- [ApiController]
- [Produces("application/json")]
- [Authorize]
- [SwaggerTag("จัดการข้อมูลตำบล เพื่อนำไปใช้งานในระบบ")]
- public class SubDistrictController : BaseController
- {
- #region " Fields "
-
- private readonly SubDistrictService _subDistrictService;
-
- #endregion
-
- #region " Constructor and Destructor "
-
- public SubDistrictController(SubDistrictService subDistrictService)
- {
- _subDistrictService = subDistrictService;
- }
-
- #endregion
-
- #region " Methods "
-
- ///
- /// อ่านข้อมูลจาก Relational Db โดยแสดงเฉพาะข้อมูลที่ Active เท่านั้น
- ///
- /// รหัสอำเภอ
- ///
- /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ
- /// ไม่ได้ Login เข้าระบบ
- /// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpGet("{district:length(36)}")]
- [ProducesResponseType(StatusCodes.Status200OK)]
- [ProducesResponseType(StatusCodes.Status401Unauthorized)]
- [ProducesResponseType(StatusCodes.Status500InternalServerError)]
- public async Task> GetsAsync(string district)
- {
- try
- {
- var items = await _subDistrictService.GetsAsync(districtId: district, showAll: false);
-
- return Success(items);
- }
- catch (Exception ex)
- {
- return Error(ex);
- }
- }
-
- #endregion
- }
-}
\ No newline at end of file
diff --git a/Data/ApplicationDbContext.cs b/Data/ApplicationDbContext.cs
index 647a69f..dda6300 100644
--- a/Data/ApplicationDbContext.cs
+++ b/Data/ApplicationDbContext.cs
@@ -15,19 +15,19 @@ namespace BMA.EHR.Recurit.Exam.Service.Data
{
}
- public DbSet Prefixes { get; set; }
+ // public DbSet Prefixes { get; set; }
- public DbSet Religions { get; set; }
+ // public DbSet Religions { get; set; }
- public DbSet Relationships { get; set; }
+ // public DbSet Relationships { get; set; }
- public DbSet EducationLevels { get; set; }
+ // public DbSet EducationLevels { get; set; }
- public DbSet Provinces { get; set; }
+ // public DbSet Provinces { get; set; }
- public DbSet Districts { get; set; }
+ // public DbSet Districts { get; set; }
- public DbSet SubDistricts { get; set; }
+ // public DbSet SubDistricts { get; set; }
public DbSet PeriodExams { get; set; }
diff --git a/Data/DatabaseSeeder.cs b/Data/DatabaseSeeder.cs
index 048af40..87cd5c9 100644
--- a/Data/DatabaseSeeder.cs
+++ b/Data/DatabaseSeeder.cs
@@ -13,302 +13,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data
#region " Seed Metadata "
- public static async Task SeedPrefixAsync(WebApplication app)
- {
- using var scope = app.Services.CreateScope();
- var service = scope.ServiceProvider.GetRequiredService();
- var insertedPrefix = new List();
-
- if ((await service.GetsAsync()).Count() == 0)
- {
- // read excels into object
- var excelFile = "SeedPerson.xlsx";
- using (var excel = new ExcelPackage(new FileInfo(excelFile)))
- {
- // 1. Seed PrefixAsync
- var workSheet = excel.Workbook.Worksheets.FirstOrDefault(x => x.Name.ToLower() == "prefix");
- var totalRows = workSheet?.Dimension.Rows;
-
- int row = 1;
-
- while (row <= totalRows)
- {
- var cell1 = workSheet?.Cells[row, 1]?.GetValue();
- if (cell1 == "" || cell1 == null) break;
-
- var prefix = insertedPrefix.Where(x => x.Name == (workSheet?.Cells[row, 1]?.GetValue() ?? "")).FirstOrDefault();
- if (prefix == null)
- {
- var inserted = new Prefix
- {
- Id = Guid.NewGuid(),
- Name = workSheet?.Cells[row, 1]?.GetValue() ?? "",
- IsActive = true,
- CreatedFullName = "System Administrator",
- CreatedAt = DateTime.Now
- };
- insertedPrefix.Add(inserted);
-
- await service.CreateAsync(inserted);
- }
- row++;
- }
- }
- }
- }
-
- public static async Task SeedReligionAsync(WebApplication app)
- {
- using var scope = app.Services.CreateScope();
- var service = scope.ServiceProvider.GetRequiredService();
- var insertedReligion = new List();
-
- if ((await service.GetsAsync()).Count() == 0)
- {
- // read excels into object
- var excelFile = "SeedPerson.xlsx";
- using (var excel = new ExcelPackage(new FileInfo(excelFile)))
- {
- // 1. Seed Religion
- var workSheet = excel.Workbook.Worksheets.FirstOrDefault(x => x.Name.ToLower() == "religion");
- var totalRows = workSheet?.Dimension.Rows;
-
- int row = 1;
-
- while (row <= totalRows)
- {
- var cell1 = workSheet?.Cells[row, 1]?.GetValue();
- if (cell1 == "" || cell1 == null) break;
-
- var religion = insertedReligion.Where(x => x.Name == (workSheet?.Cells[row, 1]?.GetValue() ?? "")).FirstOrDefault();
- if (religion == null)
- {
- var inserted = new Religion
- {
- Id = Guid.NewGuid(),
- Name = workSheet?.Cells[row, 1]?.GetValue() ?? "",
- IsActive = true,
- CreatedFullName = "System Administrator",
- CreatedAt = DateTime.Now
- };
- insertedReligion.Add(inserted);
-
- await service.CreateAsync(inserted);
- }
- row++;
- }
- }
- }
- }
-
- public static async Task SeedRelationshipAsync(WebApplication app)
- {
- using var scope = app.Services.CreateScope();
- var service = scope.ServiceProvider.GetRequiredService();
- var insertedRelationship = new List();
-
- if ((await service.GetsAsync()).Count() == 0)
- {
- // read excels into object
- var excelFile = "SeedPerson.xlsx";
- using (var excel = new ExcelPackage(new FileInfo(excelFile)))
- {
- // 1. Seed Relationship
- var workSheet = excel.Workbook.Worksheets.FirstOrDefault(x => x.Name.ToLower() == "relationship");
- var totalRows = workSheet?.Dimension.Rows;
-
- int row = 1;
-
- while (row <= totalRows)
- {
- var cell1 = workSheet?.Cells[row, 1]?.GetValue();
- if (cell1 == "" || cell1 == null) break;
-
- var relationship = insertedRelationship.Where(x => x.Name == (workSheet?.Cells[row, 1]?.GetValue() ?? "")).FirstOrDefault();
- if (relationship == null)
- {
- var inserted = new Relationship
- {
- Id = Guid.NewGuid(),
- Name = workSheet?.Cells[row, 1]?.GetValue() ?? "",
- IsActive = true,
- CreatedFullName = "System Administrator",
- CreatedAt = DateTime.Now
- };
- insertedRelationship.Add(inserted);
-
- await service.CreateAsync(inserted);
- }
- row++;
- }
- }
- }
- }
-
- public static async Task SeedEducationLevelAsync(WebApplication app)
- {
- using var scope = app.Services.CreateScope();
- var service = scope.ServiceProvider.GetRequiredService();
- var insertedEducationLevel = new List();
-
- if ((await service.GetsAsync()).Count() == 0)
- {
- // read excels into object
- var excelFile = "SeedPerson.xlsx";
- using (var excel = new ExcelPackage(new FileInfo(excelFile)))
- {
- // 1. Seed EducationLevel
- var workSheet = excel.Workbook.Worksheets.FirstOrDefault(x => x.Name.ToLower() == "educationlevel");
- var totalRows = workSheet?.Dimension.Rows;
-
- int row = 1;
-
- while (row <= totalRows)
- {
- var cell1 = workSheet?.Cells[row, 1]?.GetValue();
- if (cell1 == "" || cell1 == null) break;
-
- var educationLevel = insertedEducationLevel.Where(x => x.Name == (workSheet?.Cells[row, 1]?.GetValue() ?? "")).FirstOrDefault();
- if (educationLevel == null)
- {
- var inserted = new EducationLevel
- {
- Id = Guid.NewGuid(),
- Name = workSheet?.Cells[row, 1]?.GetValue() ?? "",
- IsActive = true,
- CreatedFullName = "System Administrator",
- CreatedAt = DateTime.Now
- };
- insertedEducationLevel.Add(inserted);
-
- await service.CreateAsync(inserted);
- }
- row++;
- }
- }
- }
- }
-
- public static async Task SeedProvinceAsync(WebApplication app)
- {
- using var scope = app.Services.CreateScope();
- var service = scope.ServiceProvider.GetRequiredService();
- var districtService = scope.ServiceProvider.GetRequiredService();
- var subDistrictService = scope.ServiceProvider.GetRequiredService();
-
- var serializeOption = new JsonSerializerSettings { ReferenceLoopHandling = ReferenceLoopHandling.Ignore };
-
- var insertedProvince = new List();
-
- if ((await service.GetsAsync()).Count() == 0)
- {
- // read excels into object
- var excelFile = "SeedPerson.xlsx";
- using (var excel = new ExcelPackage(new FileInfo(excelFile)))
- {
- // 1. Seed Province
- var workSheet = excel.Workbook.Worksheets.FirstOrDefault(x => x.Name.ToLower() == "province");
- var totalRows = workSheet?.Dimension.Rows;
-
- int row = 2;
-
- while (row <= totalRows)
- {
- var cell1 = workSheet?.Cells[row, 1]?.GetValue();
- if (cell1 == "" || cell1 == null) break;
-
- var inserted = new Province
- {
- Id = Guid.NewGuid(),
- Name = workSheet?.Cells[row, 1]?.GetValue() ?? "",
- IsActive = true,
- CreatedFullName = "System Administrator",
- CreatedAt = DateTime.Now,
- Districts = new List()
- };
- insertedProvince.Add(inserted);
-
- await service.CreateAsync(inserted);
-
- row++;
- }
-
- // 2. Seed District
- var d_workSheet = excel.Workbook.Worksheets.FirstOrDefault(x => x.Name.ToLower() == "district");
- var d_totalRows = d_workSheet?.Dimension.Rows;
-
- int d_row = 2;
-
- while (d_row <= d_totalRows)
- {
- var cell1 = d_workSheet?.Cells[d_row, 1]?.GetValue();
- if (cell1 == "" || cell1 == null) break;
-
- var province = insertedProvince.Where(x => x.Name == cell1).FirstOrDefault();
-
- var inserted = new District
- {
- Id = Guid.NewGuid(),
- Name = d_workSheet?.Cells[d_row, 2]?.GetValue() ?? "",
- IsActive = true,
- CreatedFullName = "System Administrator",
- CreatedAt = DateTime.Now,
- SubDistricts = new List()
- };
-
- province?.Districts.Add(inserted);
- var provinceId = province == null ? Guid.NewGuid() : province.Id;
-
- var jsonString = JsonConvert.SerializeObject(inserted, serializeOption);
-
- await districtService.CreateAsync(inserted, provinceId.ToString("D"));
-
- d_row++;
- }
-
-
- // 3. Seed SubDistrict
- var s_workSheet = excel.Workbook.Worksheets.FirstOrDefault(x => x.Name.ToLower() == "subdistrict");
- var s_totalRows = s_workSheet?.Dimension.Rows;
-
- int s_row = 2;
- var zipcodes = new List();
-
- while (s_row <= s_totalRows)
- {
- var cell1 = s_workSheet?.Cells[s_row, 1]?.GetValue();
- var cell2 = s_workSheet?.Cells[s_row, 2]?.GetValue();
- if (cell1 == "" || cell1 == null) break;
-
- var province = insertedProvince.Where(x => x.Name == cell1).FirstOrDefault();
- var district = province?.Districts.Where(x => x.Name == cell2).FirstOrDefault();
-
- var inserted = new SubDistrict
- {
- Id = Guid.NewGuid(),
- Name = s_workSheet?.Cells[s_row, 3]?.GetValue() ?? "",
- ZipCode = s_workSheet?.Cells[s_row, 4]?.GetValue() ?? "",
- IsActive = true,
- CreatedFullName = "System Administrator",
- CreatedAt = DateTime.Now,
-
- };
-
- if (!zipcodes.Contains(inserted.ZipCode))
- zipcodes.Add(inserted.ZipCode);
-
- district?.SubDistricts.Add(inserted);
- var districtId = district == null ? Guid.NewGuid() : district.Id;
-
- var jsonString = JsonConvert.SerializeObject(inserted, serializeOption);
-
- await subDistrictService.CreateAsync(inserted, districtId.ToString("D"));
-
- s_row++;
- }
- }
- }
- }
public static async Task SeedPeriodExamAsync(WebApplication app)
{
// using var scope = app.Services.CreateScope();
diff --git a/Data/MetadataDbContext.cs b/Data/MetadataDbContext.cs
new file mode 100644
index 0000000..683d926
--- /dev/null
+++ b/Data/MetadataDbContext.cs
@@ -0,0 +1,55 @@
+using BMA.EHR.Recurit.Exam.Service.Models;
+using BMA.EHR.Recurit.Exam.Service.Models.Documents;
+using Microsoft.EntityFrameworkCore;
+
+namespace BMA.EHR.Recurit.Exam.Service.Data
+{
+ public class MetadataDbContext : DbContext
+ {
+ public MetadataDbContext(DbContextOptions options)
+ : base(options)
+ {
+ }
+
+ protected override void OnModelCreating(ModelBuilder modelBuilder)
+ {
+ }
+
+ // The following configures EF to create a Sqlite database file in the
+ // special "local" folder for your platform.
+ protected override void OnConfiguring(DbContextOptionsBuilder options)
+ {
+ if (!options.IsConfigured)
+ {
+ var environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production";
+ var configurationBuilder = new ConfigurationBuilder()
+ .AddJsonFile("appsettings.json", optional: true, true)
+ .AddJsonFile($"appsettings.{environment}.json", true, true)
+ .AddEnvironmentVariables()
+ .Build();
+
+ var historyConnection = configurationBuilder.GetConnectionString("HistoryConnection");
+ options.UseMySql(historyConnection, ServerVersion.AutoDetect(historyConnection));
+
+ }
+ }
+
+ public DbSet Prefixes { get; set; }
+
+ public DbSet Religions { get; set; }
+
+ public DbSet EducationLevels { get; set; }
+
+ public DbSet Relationships { get; set; }
+
+ public DbSet Provinces { get; set; }
+
+ public DbSet Districts { get; set; }
+
+ public DbSet SubDistricts { get; set; }
+
+ public DbSet OrganizationOrganizations { get; set; }
+
+ public DbSet OrganizationShortNames { get; set; }
+ }
+}
diff --git a/Data/Migrations/ApplicationDbContextModelSnapshot.cs b/Data/Migrations/ApplicationDbContextModelSnapshot.cs
index 1b0cf5c..68fb53b 100644
--- a/Data/Migrations/ApplicationDbContextModelSnapshot.cs
+++ b/Data/Migrations/ApplicationDbContextModelSnapshot.cs
@@ -168,7 +168,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
b.Property("Address")
.HasColumnType("longtext")
- .HasComment("ที่อยู่");
+ .HasComment("ที่อยู่ปัจจุบัน");
b.Property("BannerImgId")
.HasColumnType("char(36)");
@@ -197,7 +197,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.HasComment("ข้อมูลเว็บโดยย่อ");
b.Property("DistrictId")
- .HasColumnType("char(36)");
+ .HasColumnType("char(36)")
+ .HasComment("Id อำเภอ");
+
+ b.Property("DistrictName")
+ .HasColumnType("longtext")
+ .HasComment("อำเภอ");
b.Property("LastUpdateFullName")
.IsRequired()
@@ -230,14 +235,24 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.HasComment("ชื่อเว็บภาษาไทย");
b.Property("ProvinceId")
- .HasColumnType("char(36)");
+ .HasColumnType("char(36)")
+ .HasComment("Id จังหวัด");
+
+ b.Property("ProvinceName")
+ .HasColumnType("longtext")
+ .HasComment("จังหวัด");
b.Property("ShortName")
.HasColumnType("longtext")
.HasComment("ชื่อย่อ");
b.Property("SubDistrictId")
- .HasColumnType("char(36)");
+ .HasColumnType("char(36)")
+ .HasComment("Id ตำบล");
+
+ b.Property("SubDistrictName")
+ .HasColumnType("longtext")
+ .HasComment("ตำบล");
b.Property("Telephone")
.HasMaxLength(20)
@@ -253,14 +268,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
b.HasIndex("BannerImgId");
- b.HasIndex("DistrictId");
-
b.HasIndex("LogoImgId");
- b.HasIndex("ProvinceId");
-
- b.HasIndex("SubDistrictId");
-
b.ToTable("CMSCandidates");
});
@@ -343,7 +352,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.HasComment("วันที่ออกบัตร");
b.Property("CitizenDistrictId")
- .HasColumnType("char(36)");
+ .HasColumnType("char(36)")
+ .HasComment("Id เขตที่ออกบัตรประชาชน");
+
+ b.Property("CitizenDistrictName")
+ .HasColumnType("longtext")
+ .HasComment("เขตที่ออกบัตรประชาชน");
b.Property("CitizenId")
.HasMaxLength(20)
@@ -351,7 +365,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.HasComment("เลขประจำตัวประชาชน");
b.Property("CitizenProvinceId")
- .HasColumnType("char(36)");
+ .HasColumnType("char(36)")
+ .HasComment("Id จังหวัดที่ออกบัตรประชาชน");
+
+ b.Property("CitizenProvinceName")
+ .HasColumnType("longtext")
+ .HasComment("จังหวัดที่ออกบัตรประชาชน");
b.Property("CreatedAt")
.HasColumnType("datetime(6)")
@@ -377,13 +396,28 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.HasComment("ที่อยู่ปัจจุบัน");
b.Property("CurrentDistrictId")
- .HasColumnType("char(36)");
+ .HasColumnType("char(36)")
+ .HasComment("Id อำเภอที่อยู่ปัจจุบัน");
+
+ b.Property("CurrentDistrictName")
+ .HasColumnType("longtext")
+ .HasComment("อำเภอที่อยู่ปัจจุบัน");
b.Property("CurrentProvinceId")
- .HasColumnType("char(36)");
+ .HasColumnType("char(36)")
+ .HasComment("Id จังหวัดที่อยู่ปัจจุบัน");
+
+ b.Property("CurrentProvinceName")
+ .HasColumnType("longtext")
+ .HasComment("จังหวัดที่อยู่ปัจจุบัน");
b.Property("CurrentSubDistrictId")
- .HasColumnType("char(36)");
+ .HasColumnType("char(36)")
+ .HasComment("Id ตำบลที่อยู่ปัจจุบัน");
+
+ b.Property("CurrentSubDistrictName")
+ .HasColumnType("longtext")
+ .HasComment("ตำบลที่อยู่ปัจจุบัน");
b.Property("CurrentZipCode")
.HasMaxLength(10)
@@ -425,7 +459,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.HasComment("อาชีพบิดา");
b.Property("FatherPrefixId")
- .HasColumnType("char(36)");
+ .HasColumnType("char(36)")
+ .HasComment("Id คำนำหน้าชื่อบิดา");
+
+ b.Property("FatherPrefixName")
+ .HasColumnType("longtext")
+ .HasComment("คำนำหน้าชื่อบิดา");
b.Property("FirstName")
.HasMaxLength(100)
@@ -487,7 +526,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.HasComment("อาชีพคู่สมรส");
b.Property("MarryPrefixId")
- .HasColumnType("char(36)");
+ .HasColumnType("char(36)")
+ .HasComment("Id คำนำหน้าชื่อคู่สมรส");
+
+ b.Property("MarryPrefixName")
+ .HasColumnType("longtext")
+ .HasComment("คำนำหน้าชื่อคู่สมรส");
b.Property("MobilePhone")
.HasMaxLength(20)
@@ -515,7 +559,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.HasComment("อาชีพมารดา");
b.Property("MotherPrefixId")
- .HasColumnType("char(36)");
+ .HasColumnType("char(36)")
+ .HasComment("Id คำนำหน้าชื่อมารดา");
+
+ b.Property("MotherPrefixName")
+ .HasColumnType("longtext")
+ .HasComment("คำนำหน้าชื่อมารดา");
b.Property("Nationality")
.HasMaxLength(40)
@@ -563,7 +612,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.HasColumnType("char(36)");
b.Property("PrefixId")
- .HasColumnType("char(36)");
+ .HasColumnType("char(36)")
+ .HasComment("Id คำนำหน้าชื่อ");
+
+ b.Property("PrefixName")
+ .HasColumnType("longtext")
+ .HasComment("คำนำหน้าชื่อ");
b.Property("ProfileImgId")
.HasColumnType("char(36)");
@@ -573,17 +627,32 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.HasComment("ที่อยู่ตามทะเบียนบ้าน");
b.Property("RegistDistrictId")
- .HasColumnType("char(36)");
+ .HasColumnType("char(36)")
+ .HasComment("Id อำเภอที่อยู่ตามทะเบียนบ้าน");
+
+ b.Property("RegistDistrictName")
+ .HasColumnType("longtext")
+ .HasComment("อำเภอที่อยู่ตามทะเบียนบ้าน");
b.Property("RegistProvinceId")
- .HasColumnType("char(36)");
+ .HasColumnType("char(36)")
+ .HasComment("Id จังหวัดที่อยู่ตามทะเบียนบ้าน");
+
+ b.Property("RegistProvinceName")
+ .HasColumnType("longtext")
+ .HasComment("จังหวัดที่อยู่ตามทะเบียนบ้าน");
b.Property("RegistSame")
.HasColumnType("tinyint(1)")
.HasComment("ที่อยู่ปัจจุบันเหมือนที่อยู่ตามทะเบียนบ้าน");
b.Property("RegistSubDistrictId")
- .HasColumnType("char(36)");
+ .HasColumnType("char(36)")
+ .HasComment("Id ตำบลที่อยู่ตามทะเบียนบ้าน");
+
+ b.Property("RegistSubDistrictName")
+ .HasColumnType("longtext")
+ .HasComment("ตำบลที่อยู่ตามทะเบียนบ้าน");
b.Property("RegistZipCode")
.HasMaxLength(10)
@@ -595,7 +664,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.HasComment("เหตุผลการไม่อนุมัติ");
b.Property("RelationshipId")
- .HasColumnType("char(36)");
+ .HasColumnType("char(36)")
+ .HasComment("Id ศาสนา");
+
+ b.Property("RelationshipName")
+ .HasColumnType("longtext")
+ .HasComment("ศาสนา");
b.Property("SeatNumber")
.HasColumnType("longtext")
@@ -620,40 +694,14 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
b.HasKey("Id");
- b.HasIndex("CitizenDistrictId");
-
- b.HasIndex("CitizenProvinceId");
-
- b.HasIndex("CurrentDistrictId");
-
- b.HasIndex("CurrentProvinceId");
-
- b.HasIndex("CurrentSubDistrictId");
-
- b.HasIndex("FatherPrefixId");
-
- b.HasIndex("MarryPrefixId");
-
- b.HasIndex("MotherPrefixId");
-
b.HasIndex("PaymentImgId");
b.HasIndex("PeriodExamId");
b.HasIndex("PositionExamId");
- b.HasIndex("PrefixId");
-
b.HasIndex("ProfileImgId");
- b.HasIndex("RegistDistrictId");
-
- b.HasIndex("RegistProvinceId");
-
- b.HasIndex("RegistSubDistrictId");
-
- b.HasIndex("RelationshipId");
-
b.ToTable("Candidates");
});
@@ -810,75 +858,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
b.ToTable("Careers");
});
- modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.District", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("char(36)")
- .HasColumnOrder(0)
- .HasComment("PrimaryKey")
- .HasAnnotation("Relational:JsonPropertyName", "id");
-
- b.Property("CreatedAt")
- .HasColumnType("datetime(6)")
- .HasColumnOrder(100)
- .HasComment("สร้างข้อมูลเมื่อ");
-
- b.Property("CreatedFullName")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("varchar(200)")
- .HasColumnOrder(104)
- .HasComment("ชื่อ User ที่สร้างข้อมูล");
-
- b.Property("CreatedUserId")
- .IsRequired()
- .HasMaxLength(40)
- .HasColumnType("varchar(40)")
- .HasColumnOrder(101)
- .HasComment("User Id ที่สร้างข้อมูล");
-
- b.Property("IsActive")
- .HasColumnType("tinyint(1)")
- .HasColumnOrder(2)
- .HasComment("สถานะการใช้งาน");
-
- b.Property("LastUpdateFullName")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("varchar(200)")
- .HasColumnOrder(105)
- .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
-
- b.Property("LastUpdateUserId")
- .IsRequired()
- .HasMaxLength(40)
- .HasColumnType("varchar(40)")
- .HasColumnOrder(103)
- .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
-
- b.Property("LastUpdatedAt")
- .HasColumnType("datetime(6)")
- .HasColumnOrder(102)
- .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(150)
- .HasColumnType("varchar(150)")
- .HasColumnOrder(1)
- .HasComment("เขต/อำเภอ");
-
- b.Property("ProvinceId")
- .HasColumnType("char(36)");
-
- b.HasKey("Id");
-
- b.HasIndex("ProvinceId");
-
- b.ToTable("Districts");
- });
-
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", b =>
{
b.Property("Id")
@@ -954,8 +933,13 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.HasColumnOrder(1)
.HasComment("ระยะเวลาเริ่ม");
- b.Property("EducationLevelId")
- .HasColumnType("char(36)");
+ b.Property("EducationLevelId")
+ .HasColumnType("char(36)")
+ .HasComment("Idวุฒิที่ได้รับ");
+
+ b.Property("EducationLevelName")
+ .HasColumnType("longtext")
+ .HasComment("วุฒิที่ได้รับ");
b.Property("LastUpdateFullName")
.IsRequired()
@@ -998,75 +982,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
b.HasIndex("CandidateId");
- b.HasIndex("EducationLevelId");
-
b.ToTable("Educations");
});
- modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.EducationLevel", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("char(36)")
- .HasColumnOrder(0)
- .HasComment("PrimaryKey")
- .HasAnnotation("Relational:JsonPropertyName", "id");
-
- b.Property("CreatedAt")
- .HasColumnType("datetime(6)")
- .HasColumnOrder(100)
- .HasComment("สร้างข้อมูลเมื่อ");
-
- b.Property("CreatedFullName")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("varchar(200)")
- .HasColumnOrder(104)
- .HasComment("ชื่อ User ที่สร้างข้อมูล");
-
- b.Property("CreatedUserId")
- .IsRequired()
- .HasMaxLength(40)
- .HasColumnType("varchar(40)")
- .HasColumnOrder(101)
- .HasComment("User Id ที่สร้างข้อมูล");
-
- b.Property("IsActive")
- .HasColumnType("tinyint(1)")
- .HasColumnOrder(2)
- .HasComment("สถานะการใช้งาน");
-
- b.Property("LastUpdateFullName")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("varchar(200)")
- .HasColumnOrder(105)
- .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
-
- b.Property("LastUpdateUserId")
- .IsRequired()
- .HasMaxLength(40)
- .HasColumnType("varchar(40)")
- .HasColumnOrder(103)
- .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
-
- b.Property("LastUpdatedAt")
- .HasColumnType("datetime(6)")
- .HasColumnOrder(102)
- .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("varchar(100)")
- .HasColumnOrder(1)
- .HasComment("ระดับการศึกษา");
-
- b.HasKey("Id");
-
- b.ToTable("EducationLevels");
- });
-
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", b =>
{
b.Property("Id")
@@ -1414,338 +1332,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
b.ToTable("PositionExams");
});
- modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Prefix", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("char(36)")
- .HasColumnOrder(0)
- .HasComment("PrimaryKey")
- .HasAnnotation("Relational:JsonPropertyName", "id");
-
- b.Property("CreatedAt")
- .HasColumnType("datetime(6)")
- .HasColumnOrder(100)
- .HasComment("สร้างข้อมูลเมื่อ");
-
- b.Property("CreatedFullName")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("varchar(200)")
- .HasColumnOrder(104)
- .HasComment("ชื่อ User ที่สร้างข้อมูล");
-
- b.Property("CreatedUserId")
- .IsRequired()
- .HasMaxLength(40)
- .HasColumnType("varchar(40)")
- .HasColumnOrder(101)
- .HasComment("User Id ที่สร้างข้อมูล");
-
- b.Property("IsActive")
- .HasColumnType("tinyint(1)")
- .HasColumnOrder(3)
- .HasComment("สถานะการใช้งาน");
-
- b.Property("LastUpdateFullName")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("varchar(200)")
- .HasColumnOrder(105)
- .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
-
- b.Property("LastUpdateUserId")
- .IsRequired()
- .HasMaxLength(40)
- .HasColumnType("varchar(40)")
- .HasColumnOrder(103)
- .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
-
- b.Property("LastUpdatedAt")
- .HasColumnType("datetime(6)")
- .HasColumnOrder(102)
- .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("varchar(50)")
- .HasColumnOrder(2)
- .HasComment("รายละเอียดคำนำหน้า");
-
- b.HasKey("Id");
-
- b.ToTable("Prefixes");
- });
-
- modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Province", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("char(36)")
- .HasColumnOrder(0)
- .HasComment("PrimaryKey")
- .HasAnnotation("Relational:JsonPropertyName", "id");
-
- b.Property("CreatedAt")
- .HasColumnType("datetime(6)")
- .HasColumnOrder(100)
- .HasComment("สร้างข้อมูลเมื่อ");
-
- b.Property("CreatedFullName")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("varchar(200)")
- .HasColumnOrder(104)
- .HasComment("ชื่อ User ที่สร้างข้อมูล");
-
- b.Property("CreatedUserId")
- .IsRequired()
- .HasMaxLength(40)
- .HasColumnType("varchar(40)")
- .HasColumnOrder(101)
- .HasComment("User Id ที่สร้างข้อมูล");
-
- b.Property("IsActive")
- .HasColumnType("tinyint(1)")
- .HasColumnOrder(2)
- .HasComment("สถานะการใช้งาน");
-
- b.Property("LastUpdateFullName")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("varchar(200)")
- .HasColumnOrder(105)
- .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
-
- b.Property("LastUpdateUserId")
- .IsRequired()
- .HasMaxLength(40)
- .HasColumnType("varchar(40)")
- .HasColumnOrder(103)
- .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
-
- b.Property("LastUpdatedAt")
- .HasColumnType("datetime(6)")
- .HasColumnOrder(102)
- .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(150)
- .HasColumnType("varchar(150)")
- .HasColumnOrder(1)
- .HasComment("จังหวัด");
-
- b.HasKey("Id");
-
- b.ToTable("Provinces");
- });
-
- modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Relationship", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("char(36)")
- .HasColumnOrder(0)
- .HasComment("PrimaryKey")
- .HasAnnotation("Relational:JsonPropertyName", "id");
-
- b.Property("CreatedAt")
- .HasColumnType("datetime(6)")
- .HasColumnOrder(100)
- .HasComment("สร้างข้อมูลเมื่อ");
-
- b.Property("CreatedFullName")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("varchar(200)")
- .HasColumnOrder(104)
- .HasComment("ชื่อ User ที่สร้างข้อมูล");
-
- b.Property("CreatedUserId")
- .IsRequired()
- .HasMaxLength(40)
- .HasColumnType("varchar(40)")
- .HasColumnOrder(101)
- .HasComment("User Id ที่สร้างข้อมูล");
-
- b.Property("IsActive")
- .HasColumnType("tinyint(1)")
- .HasColumnOrder(2)
- .HasComment("สถานะการใช้งาน");
-
- b.Property("LastUpdateFullName")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("varchar(200)")
- .HasColumnOrder(105)
- .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
-
- b.Property("LastUpdateUserId")
- .IsRequired()
- .HasMaxLength(40)
- .HasColumnType("varchar(40)")
- .HasColumnOrder(103)
- .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
-
- b.Property("LastUpdatedAt")
- .HasColumnType("datetime(6)")
- .HasColumnOrder(102)
- .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("varchar(50)")
- .HasColumnOrder(1)
- .HasComment("ชื่อความสัมพันธ์");
-
- b.HasKey("Id");
-
- b.ToTable("Relationships");
- });
-
- modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Religion", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("char(36)")
- .HasColumnOrder(0)
- .HasComment("PrimaryKey")
- .HasAnnotation("Relational:JsonPropertyName", "id");
-
- b.Property("CreatedAt")
- .HasColumnType("datetime(6)")
- .HasColumnOrder(100)
- .HasComment("สร้างข้อมูลเมื่อ");
-
- b.Property("CreatedFullName")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("varchar(200)")
- .HasColumnOrder(104)
- .HasComment("ชื่อ User ที่สร้างข้อมูล");
-
- b.Property("CreatedUserId")
- .IsRequired()
- .HasMaxLength(40)
- .HasColumnType("varchar(40)")
- .HasColumnOrder(101)
- .HasComment("User Id ที่สร้างข้อมูล");
-
- b.Property("IsActive")
- .HasColumnType("tinyint(1)")
- .HasColumnOrder(2)
- .HasComment("สถานะการใช้งาน");
-
- b.Property("LastUpdateFullName")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("varchar(200)")
- .HasColumnOrder(105)
- .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
-
- b.Property("LastUpdateUserId")
- .IsRequired()
- .HasMaxLength(40)
- .HasColumnType("varchar(40)")
- .HasColumnOrder(103)
- .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
-
- b.Property("LastUpdatedAt")
- .HasColumnType("datetime(6)")
- .HasColumnOrder(102)
- .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("varchar(100)")
- .HasColumnOrder(1)
- .HasComment("ศาสนา");
-
- b.HasKey("Id");
-
- b.ToTable("Religions");
- });
-
- modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.SubDistrict", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("char(36)")
- .HasColumnOrder(0)
- .HasComment("PrimaryKey")
- .HasAnnotation("Relational:JsonPropertyName", "id");
-
- b.Property("CreatedAt")
- .HasColumnType("datetime(6)")
- .HasColumnOrder(100)
- .HasComment("สร้างข้อมูลเมื่อ");
-
- b.Property("CreatedFullName")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("varchar(200)")
- .HasColumnOrder(104)
- .HasComment("ชื่อ User ที่สร้างข้อมูล");
-
- b.Property("CreatedUserId")
- .IsRequired()
- .HasMaxLength(40)
- .HasColumnType("varchar(40)")
- .HasColumnOrder(101)
- .HasComment("User Id ที่สร้างข้อมูล");
-
- b.Property("DistrictId")
- .HasColumnType("char(36)");
-
- b.Property("IsActive")
- .HasColumnType("tinyint(1)")
- .HasColumnOrder(3)
- .HasComment("สถานะการใช้งาน");
-
- b.Property("LastUpdateFullName")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("varchar(200)")
- .HasColumnOrder(105)
- .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
-
- b.Property("LastUpdateUserId")
- .IsRequired()
- .HasMaxLength(40)
- .HasColumnType("varchar(40)")
- .HasColumnOrder(103)
- .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
-
- b.Property("LastUpdatedAt")
- .HasColumnType("datetime(6)")
- .HasColumnOrder(102)
- .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(150)
- .HasColumnType("varchar(150)")
- .HasColumnOrder(1)
- .HasComment("เขต/อำเภอ");
-
- b.Property("ZipCode")
- .IsRequired()
- .HasMaxLength(10)
- .HasColumnType("varchar(10)")
- .HasColumnOrder(2)
- .HasComment("รหัสไปรษณีย์");
-
- b.HasKey("Id");
-
- b.HasIndex("DistrictId");
-
- b.ToTable("SubDistricts");
- });
-
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.BankExam", b =>
{
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam")
@@ -1774,31 +1360,13 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.WithMany()
.HasForeignKey("BannerImgId");
- b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.District", "District")
- .WithMany()
- .HasForeignKey("DistrictId");
-
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "LogoImg")
.WithMany()
.HasForeignKey("LogoImgId");
- b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Province", "Province")
- .WithMany()
- .HasForeignKey("ProvinceId");
-
- b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.SubDistrict", "SubDistrict")
- .WithMany()
- .HasForeignKey("SubDistrictId");
-
b.Navigation("BannerImg");
- b.Navigation("District");
-
b.Navigation("LogoImg");
-
- b.Navigation("Province");
-
- b.Navigation("SubDistrict");
});
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSGovernment", b =>
@@ -1814,38 +1382,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Candidate", b =>
{
- b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.District", "CitizenDistrict")
- .WithMany()
- .HasForeignKey("CitizenDistrictId");
-
- b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Province", "CitizenProvince")
- .WithMany()
- .HasForeignKey("CitizenProvinceId");
-
- b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.District", "CurrentDistrict")
- .WithMany()
- .HasForeignKey("CurrentDistrictId");
-
- b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Province", "CurrentProvince")
- .WithMany()
- .HasForeignKey("CurrentProvinceId");
-
- b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.SubDistrict", "CurrentSubDistrict")
- .WithMany()
- .HasForeignKey("CurrentSubDistrictId");
-
- b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Prefix", "FatherPrefix")
- .WithMany()
- .HasForeignKey("FatherPrefixId");
-
- b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Prefix", "MarryPrefix")
- .WithMany()
- .HasForeignKey("MarryPrefixId");
-
- b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Prefix", "MotherPrefix")
- .WithMany()
- .HasForeignKey("MotherPrefixId");
-
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "PaymentImg")
.WithMany()
.HasForeignKey("PaymentImgId");
@@ -1860,63 +1396,17 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.WithMany()
.HasForeignKey("PositionExamId");
- b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Prefix", "Prefix")
- .WithMany()
- .HasForeignKey("PrefixId");
-
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "ProfileImg")
.WithMany()
.HasForeignKey("ProfileImgId");
- b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.District", "RegistDistrict")
- .WithMany()
- .HasForeignKey("RegistDistrictId");
-
- b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Province", "RegistProvince")
- .WithMany()
- .HasForeignKey("RegistProvinceId");
-
- b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.SubDistrict", "RegistSubDistrict")
- .WithMany()
- .HasForeignKey("RegistSubDistrictId");
-
- b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Relationship", "Relationship")
- .WithMany()
- .HasForeignKey("RelationshipId");
-
- b.Navigation("CitizenDistrict");
-
- b.Navigation("CitizenProvince");
-
- b.Navigation("CurrentDistrict");
-
- b.Navigation("CurrentProvince");
-
- b.Navigation("CurrentSubDistrict");
-
- b.Navigation("FatherPrefix");
-
- b.Navigation("MarryPrefix");
-
- b.Navigation("MotherPrefix");
-
b.Navigation("PaymentImg");
b.Navigation("PeriodExam");
b.Navigation("PositionExam");
- b.Navigation("Prefix");
-
b.Navigation("ProfileImg");
-
- b.Navigation("RegistDistrict");
-
- b.Navigation("RegistProvince");
-
- b.Navigation("RegistSubDistrict");
-
- b.Navigation("Relationship");
});
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CandidateDocument", b =>
@@ -1949,15 +1439,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
b.Navigation("Candidate");
});
- modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.District", b =>
- {
- b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Province", "Province")
- .WithMany("Districts")
- .HasForeignKey("ProvinceId");
-
- b.Navigation("Province");
- });
-
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Education", b =>
{
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Candidate", "Candidate")
@@ -1966,15 +1447,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
- b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.EducationLevel", "EducationLevel")
- .WithMany()
- .HasForeignKey("EducationLevelId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
b.Navigation("Candidate");
-
- b.Navigation("EducationLevel");
});
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamDocument", b =>
@@ -2026,15 +1499,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
b.Navigation("PeriodExam");
});
- modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.SubDistrict", b =>
- {
- b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.District", "District")
- .WithMany("SubDistricts")
- .HasForeignKey("DistrictId");
-
- b.Navigation("District");
- });
-
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSCandidate", b =>
{
b.Navigation("CMSAgencys");
@@ -2042,11 +1506,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
b.Navigation("CMSGovernments");
});
- modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.District", b =>
- {
- b.Navigation("SubDistricts");
- });
-
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", b =>
{
b.Navigation("BankExam");
@@ -2059,11 +1518,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
b.Navigation("PositionExam");
});
-
- modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Province", b =>
- {
- b.Navigation("Districts");
- });
#pragma warning restore 612, 618
}
}
diff --git a/Migrations/20230410055737_update table metadata use key main.Designer.cs b/Migrations/20230410055737_update table metadata use key main.Designer.cs
new file mode 100644
index 0000000..2607b85
--- /dev/null
+++ b/Migrations/20230410055737_update table metadata use key main.Designer.cs
@@ -0,0 +1,1527 @@
+//
+using System;
+using BMA.EHR.Recurit.Exam.Service.Data;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace BMA.EHR.Recurit.Exam.Service.Migrations
+{
+ [DbContext(typeof(ApplicationDbContext))]
+ [Migration("20230410055737_update table metadata use key main")]
+ partial class updatetablemetadatausekeymain
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "7.0.4")
+ .HasAnnotation("Relational:MaxIdentifierLength", 64);
+
+ modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.BankExam", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("AccountName")
+ .HasColumnType("longtext")
+ .HasComment("ชื่อบัญชี");
+
+ b.Property("AccountNumber")
+ .HasColumnType("longtext")
+ .HasComment("เลขบัญชี");
+
+ b.Property("BankName")
+ .HasColumnType("longtext")
+ .HasComment("ธนาคาร");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.Property("PeriodExamId")
+ .HasColumnType("char(36)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("PeriodExamId");
+
+ b.ToTable("BankExams");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSAgency", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CMSCandidateId")
+ .HasColumnType("char(36)");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.Property("Link")
+ .HasColumnType("longtext")
+ .HasComment("ลิงค์");
+
+ b.Property("Name")
+ .HasColumnType("longtext")
+ .HasComment("ชื่อลิงค์");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CMSCandidateId");
+
+ b.ToTable("CMSAgencys");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSCandidate", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("About")
+ .HasColumnType("longtext")
+ .HasComment("ข้อมูลเกี่ยวกับเรา");
+
+ b.Property("Address")
+ .HasColumnType("longtext")
+ .HasComment("ที่อยู่ปัจจุบัน");
+
+ b.Property("BannerImgId")
+ .HasColumnType("char(36)");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("Description")
+ .HasColumnType("longtext")
+ .HasComment("ข้อมูลเว็บโดยย่อ");
+
+ b.Property("DistrictId")
+ .HasColumnType("char(36)")
+ .HasComment("Id อำเภอ");
+
+ b.Property("DistrictName")
+ .HasColumnType("longtext")
+ .HasComment("อำเภอ");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.Property("LogoImgId")
+ .HasColumnType("char(36)");
+
+ b.Property("NameEn")
+ .HasColumnType("longtext")
+ .HasComment("ชื่อเว็บภาษาอังกฤษ");
+
+ b.Property("NameTh")
+ .HasColumnType("longtext")
+ .HasComment("ชื่อเว็บภาษาไทย");
+
+ b.Property("ProvinceId")
+ .HasColumnType("char(36)")
+ .HasComment("Id จังหวัด");
+
+ b.Property("ProvinceName")
+ .HasColumnType("longtext")
+ .HasComment("จังหวัด");
+
+ b.Property("ShortName")
+ .HasColumnType("longtext")
+ .HasComment("ชื่อย่อ");
+
+ b.Property("SubDistrictId")
+ .HasColumnType("char(36)")
+ .HasComment("Id ตำบล");
+
+ b.Property("SubDistrictName")
+ .HasColumnType("longtext")
+ .HasComment("ตำบล");
+
+ b.Property("Telephone")
+ .HasMaxLength(20)
+ .HasColumnType("varchar(20)")
+ .HasComment("โทรศัพท์");
+
+ b.Property("ZipCode")
+ .HasMaxLength(10)
+ .HasColumnType("varchar(10)")
+ .HasComment("รหัสไปรษณีย์");
+
+ b.HasKey("Id");
+
+ b.HasIndex("BannerImgId");
+
+ b.HasIndex("LogoImgId");
+
+ b.ToTable("CMSCandidates");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSGovernment", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CMSCandidateId")
+ .HasColumnType("char(36)");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.Property("Link")
+ .HasColumnType("longtext")
+ .HasComment("ลิงค์");
+
+ b.Property("Name")
+ .HasColumnType("longtext")
+ .HasComment("ชื่อลิงค์");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CMSCandidateId");
+
+ b.ToTable("CMSGovernments");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Candidate", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CitizenDate")
+ .HasColumnType("datetime(6)")
+ .HasComment("วันที่ออกบัตร");
+
+ b.Property("CitizenDistrictId")
+ .HasColumnType("char(36)")
+ .HasComment("Id เขตที่ออกบัตรประชาชน");
+
+ b.Property("CitizenDistrictName")
+ .HasColumnType("longtext")
+ .HasComment("เขตที่ออกบัตรประชาชน");
+
+ b.Property("CitizenId")
+ .HasMaxLength(20)
+ .HasColumnType("varchar(20)")
+ .HasComment("เลขประจำตัวประชาชน");
+
+ b.Property("CitizenProvinceId")
+ .HasColumnType("char(36)")
+ .HasComment("Id จังหวัดที่ออกบัตรประชาชน");
+
+ b.Property("CitizenProvinceName")
+ .HasColumnType("longtext")
+ .HasComment("จังหวัดที่ออกบัตรประชาชน");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property