diff --git a/BMA.EHR.Report.Service.csproj b/BMA.EHR.Report.Service.csproj
index d5863cc..fa7c82e 100644
--- a/BMA.EHR.Report.Service.csproj
+++ b/BMA.EHR.Report.Service.csproj
@@ -26,14 +26,15 @@
+
+
-
@@ -56,11 +57,27 @@
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
PreserveNewest
diff --git a/Controllers/ExamReportController.cs b/Controllers/ExamReportController.cs
new file mode 100644
index 0000000..31bb248
--- /dev/null
+++ b/Controllers/ExamReportController.cs
@@ -0,0 +1,254 @@
+using BMA.EHR.Profile.Service.Controllers;
+using BMA.EHR.Report.Service.Data;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.EntityFrameworkCore;
+using Swashbuckle.AspNetCore.Annotations;
+using Telerik.Reporting.Processing;
+using Telerik.Reporting;
+using BMA.EHR.Report.Service.Responses;
+using BMA.EHR.Extensions;
+
+namespace BMA.EHR.Report.Service.Controllers
+{
+ [Route("api/v{version:apiVersion}/report/exam")]
+ [ApiVersion("1.0")]
+ [ApiController]
+ [Produces("application/json")]
+ [Authorize]
+ [SwaggerTag("รายงานข้อมูลการสอบคัดเลือก")]
+ public class ExamReportController : BaseController
+ {
+ #region " Fields "
+
+ private readonly ExamDbContext _context;
+ private readonly IWebHostEnvironment _hostingEnvironment;
+ private readonly IConfiguration _configuration;
+ private readonly string space = "ㅤ";
+
+ #endregion
+
+ #region " Constructor and Destructor "
+
+ public ExamReportController(ExamDbContext context,
+ IWebHostEnvironment hostingEnvironment,
+ IConfiguration configuration)
+ {
+ this._context = context;
+ this._hostingEnvironment = hostingEnvironment;
+ this._configuration = configuration;
+ }
+
+ #endregion
+
+ #region " Methods "
+
+ #region " Privates "
+
+ private int GetExamCountTes(string citizenId)
+ {
+ try
+ {
+ var count = _context.Candidates.AsQueryable()
+ .Where(x => x.CitizenId == citizenId)
+ .Count();
+
+ return count;
+ }
+ catch
+ {
+ throw;
+ }
+ }
+
+ #endregion
+
+ ///
+ /// แสดงหนังสือรับรอง
+ ///
+ /// รหัสรอบการสอบ
+ /// เลขประจำตัวผู้สมัครสอบ
+ /// ชนิดของรายงาน
+ ///
+ /// เมื่อแสดงรายงานสำเร็จ
+ /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+
+ [HttpGet("certificate/{type:int}/{id:length(36)}/{examId}")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status400BadRequest)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> GetCertificateReportAsync(Guid id, string examId, int type)
+ {
+ try
+ {
+ var data = await _context.Disables.AsQueryable()
+ .Include(x => x.PeriodExam)
+ .Where(x => x.PeriodExam.Id == id)
+ .Where(x => x.ExamId == examId)
+ .Join(_context.DisableScores.AsQueryable()
+ .Include(x => x.ScoreImport),
+ rc => new { rc.PeriodExam.Year, rc.ExamId },
+ sc => new { sc.ScoreImport.Year, sc.ExamId },
+ (p, sr) => new
+ {
+ ExamID = p.ExamId,
+ p.CitizenId,
+ Order = p.PeriodExam.Round,
+ Year = p.PeriodExam.Year.Value.ToThaiYear(),
+ FullName = $"{p.Prefix}{p.FirstName} {p.LastName}",
+ ExamResult = sr == null ? "" : sr.ExamStatus,
+ EndDate = p.PeriodExam.RegisterEndDate.ToThaiFullDate3(),
+ AuthName = "นายณัฐพงศ์ ดิษยบุตร",
+ AuthPosition = "หัวหน้าสำนักงาน ก.ก."
+ })
+ .FirstOrDefaultAsync();
+
+ var rptFile = Path.Combine(_hostingEnvironment.ContentRootPath, "Report", "Recruit", $"rptCertificate{type}.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 = data;
+ 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 content = result.DocumentBytes;
+ return File(content, "application/pdf", $"หนังสือรับรอง_{data.CitizenId}_{data.FullName}.pdf");
+
+ }
+ catch (Exception ex)
+ {
+ return Error(ex, "เกิดข้อผิดพลาดในการแสดงรายงาน");
+ }
+ }
+
+ ///
+ /// แสดงเอกสารผลสอบ
+ ///
+ /// รหัสรอบการสอบ
+ /// เลขประจำตัวผู้สมัครสอบ
+ ///
+ /// เมื่อแสดงรายงานสำเร็จ
+ /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpGet("score/{id:length(36)}/{examId}")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status400BadRequest)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> GetScoreReportAsync(Guid id, string examId)
+ {
+ try
+ {
+ var data = await _context.Disables.AsQueryable()
+ .Include(x => x.PeriodExam)
+ .Include(x => x.Documents)
+ .ThenInclude(x => x.DocumentFile)
+ .Where(x => x.PeriodExam.Id == id)
+ .Where(x => x.ExamId == examId)
+ .Join(_context.DisableScores.AsQueryable()
+ .Include(x => x.ScoreImport),
+ rc => new { rc.PeriodExam.Year, rc.ExamId },
+ sc => new { sc.ScoreImport.Year, sc.ExamId },
+ (p, sr) => new
+ {
+ ExamId = p.ExamId,
+ CitizenId = p.CitizenId,
+ p.Prefix,
+ FullName = $"{p.Prefix}{p.FirstName} {p.LastName}",
+ DateOfBirth = p.DateOfBirth.ToThaiShortDate(),
+ Gender = p.Gendor,
+ Degree = p.Educations.First().Degree,
+ Major = p.Educations.First().Major,
+ ExamResult = sr == null ? "" : sr.ExamStatus,
+ University = p.Educations.First().University,
+ PositionName = p.PositionName,
+ ExamName = $"{p.PeriodExam.Name} ครั้งที่ {p.PeriodExam.Round}/{p.PeriodExam.Year.Value.ToThaiYear()}",
+ Number = sr == null ? "" : sr.Number,
+ // ExamCount = 10,
+ // ExamCount = GetExamCountTes(p.CitizenId),
+ ScoreExpire = p.PeriodExam.AnnouncementDate == null ? "" : p.PeriodExam.AnnouncementDate.AddYears(2).ToThaiShortDate(),
+ FullA = sr == null ? 0 : sr.FullA,
+ SumA = sr == null ? 0 : sr.SumA,
+ FullB = sr == null ? 0 : sr.FullB,
+ SumB = sr == null ? 0 : sr.SumB,
+ FullC = sr == null ? 0 : sr.FullC,
+ SumC = sr == null ? 0 : sr.SumC,
+ })
+ .FirstOrDefaultAsync();
+ var rptFile = Path.Combine(_hostingEnvironment.ContentRootPath, "Report", "Recruit", $"rptExamResult.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 = data;
+ if (data != null)
+ {
+ var _data = new
+ {
+ ExamId = data.ExamId,
+ CitizenId = data.CitizenId,
+ Prefix = data.Prefix,
+ FullName = data.FullName,
+ DateOfBirth = data.DateOfBirth,
+ Gender = data.Gender,
+ Degree = data.Degree,
+ Major = data.Major,
+ ExamResult = data.ExamResult,
+ University = data.University,
+ PositionName = data.PositionName,
+ ExamName = data.ExamName,
+ Number = data.Number,
+ ExamCount = GetExamCountTes(data.CitizenId),
+ ScoreExpire = data.ScoreExpire,
+ FullA = data.FullA,
+ SumA = data.SumA,
+ FullB = data.FullB,
+ SumB = data.SumB,
+ FullC = data.FullC,
+ SumC = data.SumC,
+ };
+ report.DataSource = _data;
+ }
+ 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 content = result.DocumentBytes;
+ return File(content, "application/pdf", $"ผลคะแนนสอบ_{data.CitizenId}_{data.FullName}.pdf");
+ }
+ catch (Exception ex)
+ {
+ return Error(ex, "เกิดข้อผิดพลาดในการแสดงรายงาน");
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/Controllers/OrganizationReportController.cs b/Controllers/OrganizationReportController.cs
new file mode 100644
index 0000000..895eab2
--- /dev/null
+++ b/Controllers/OrganizationReportController.cs
@@ -0,0 +1,11 @@
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+
+namespace BMA.EHR.Report.Service.Controllers
+{
+ [Route("api/[controller]")]
+ [ApiController]
+ public class OrganizationReportController : ControllerBase
+ {
+ }
+}
diff --git a/Controllers/ProfileReportController.cs b/Controllers/ProfileReportController.cs
new file mode 100644
index 0000000..3ba7629
--- /dev/null
+++ b/Controllers/ProfileReportController.cs
@@ -0,0 +1,552 @@
+using BMA.EHR.Extensions;
+using BMA.EHR.Profile.Service.Controllers;
+using BMA.EHR.Report.Service.Data;
+using BMA.EHR.Report.Service.Responses;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.EntityFrameworkCore;
+using Swashbuckle.AspNetCore.Annotations;
+using System.Runtime.Versioning;
+using System.Linq;
+using BMA.EHR.Profile.Service.Services;
+using Telerik.Reporting.Processing;
+using Telerik.Reporting;
+using System.Security.Cryptography.Pkcs;
+using static System.Runtime.InteropServices.JavaScript.JSType;
+using BMA.EHR.Recruit.Service.Services;
+using System.Drawing;
+using iText.Kernel.Pdf;
+using Microsoft.CodeAnalysis;
+using Telerik.Reporting.Drawing;
+using GreatFriends.ThaiBahtText;
+using BMA.EHR.Core;
+
+namespace BMA.EHR.Report.Service.Controllers
+{
+ [Route("api/v{version:apiVersion}/report/profile")]
+ [ApiVersion("1.0")]
+ [ApiController]
+ [Produces("application/json")]
+ //[Authorize]
+ [SwaggerTag("รายงานระบบทะเบียนประวัติ")]
+ public class ProfileReportController : BaseController
+ {
+ #region " Fields "
+
+ private readonly EHRDbContext _context;
+ private readonly IWebHostEnvironment _hostingEnvironment;
+ private readonly IConfiguration _configuration;
+ private readonly string space = "ㅤ";
+ private readonly ProfileService _profileService;
+ private readonly MinIOService _minioService;
+
+
+ #endregion
+
+ #region " Constructor and Destructor "
+
+ public ProfileReportController(EHRDbContext context,
+ IWebHostEnvironment hostingEnvironment,
+ IConfiguration configuration,
+ ProfileService profileService,
+ MinIOService minioService)
+ {
+ this._context = context;
+ this._hostingEnvironment = hostingEnvironment;
+ this._configuration = configuration;
+ this._profileService = profileService;
+ this._minioService = minioService;
+ }
+
+ #endregion
+
+ #region " Methods "
+
+ ///
+ /// แสดงหนังสือรับรอง
+ ///
+ /// รหัสข้อมูลข้าราชการ
+ ///
+ /// เมื่อแสดงรายงานสำเร็จ
+ /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+
+ [HttpGet("kp7-short/{id:length(36)}")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status400BadRequest)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> GetKp7ShortReport(Guid id)
+ {
+ try
+ {
+ var profile_salaries = (from ps in _context.ProfileSalaries.ToList()
+ join pos in _context.PositionPaths.ToList()
+ on ps.PositionId equals pos.Id
+ where ps.Profile.Id == id
+ select new
+ {
+ ProfileId = ps.Profile.Id,
+ PositionName = pos.Name,
+ ps.OcId,
+ SalaryDateAnnounce = ps.Date,
+ ps.Amount,
+ ps.PositionSalaryAmount
+ }).ToList();
+
+ var profile = (from p in _context.Profiles.ToList()
+ join pf in _context.Prefixes.ToList() on p.PrefixId equals pf.Id
+
+ where p.Id == id
+ select new
+ {
+ CitizenId = p.CitizenId,
+ Prefix = pf.Name,
+ p.FirstName,
+ p.LastName,
+ DateOfBirth = p.BirthDate.ToThaiShortDate(),
+ RegistrationAddress = "-",
+ OcFullPath = _profileService.GetOrganizationNameFullPath(p.OcId.Value, false, false),
+ DateAppoint = p.DateAppoint == null ? "" : p.DateAppoint.Value.ToThaiShortDate(),
+ Salaries = profile_salaries,
+ SalaryAmount = p.Salaries.Count == 0 ? "-"
+ : $"{p.Salaries.OrderByDescending(s => s.Date.Value).FirstOrDefault().Amount.Value.ToString("#,##0")}",
+ Education = p.Educations.Count == 0 ? "-"
+ : $"{p.Educations.OrderByDescending(e => e.EndDate.Value.Year).FirstOrDefault().Degree} {p.Educations.OrderByDescending(e => e.EndDate.Value.Year).FirstOrDefault().Field}"
+ }).FirstOrDefault();
+
+ var data = new List();
+ var c = 1;
+ if (profile.Salaries.Count == 0)
+ {
+ var ret2 = new
+ {
+ CitizenId = profile.CitizenId,
+ Prefix = profile.Prefix,
+ FirstName = profile.FirstName,
+ LastName = profile.LastName,
+ DateOfBirth = profile.DateOfBirth,
+ RegistrationAddress = profile.RegistrationAddress,
+ SalaryAmount = profile.SalaryAmount,
+ Education = profile.Education,
+ AppointText = "",
+ SalaryDate = profile.DateAppoint,
+ PositionName = "",
+ OCFullPath = profile.OcFullPath
+ };
+ data.Add(ret2);
+ }
+ var old_date = DateTime.Now;
+ var old_position = "";
+ var old_ocid = Guid.NewGuid();
+ dynamic ret;
+
+ foreach (var s in profile.Salaries)
+ {
+ //if((old_date.Date != s.SalaryDateAnnounce.Value.Date))
+ //{
+ // old_date = s.SalaryDateAnnounce.Value;
+ // old_position= s.PositionName;
+ // old_ocid = s.OcId;
+
+ // ret = new
+ // {
+ // CitizenId = profile.CitizenId,
+ // Prefix = profile.Prefix,
+ // FirstName = profile.FirstName,
+ // LastName = profile.LastName,
+ // DateOfBirth = profile.DateOfBirth,
+ // RegistrationAddress = profile.RegistrationAddress,
+ // SalaryAmount = profile.SalaryAmount,
+ // Education = profile.Education,
+ // AppointText = c == 1 ? "(เริ่มรับราชการ)" : "",
+ // SalaryDate = s.SalaryDateAnnounce.Value.ToThaiShortDate(),
+ // PositionName = s.PositionName,
+ // OCFullPath = CoreCommandReport.GetOrganizationNameFullPath(s.OcId, false, false)
+ // };
+ // data.Add(ret);
+ //}
+ if (old_position != s.PositionName)
+ {
+ old_date = s.SalaryDateAnnounce.Value;
+ old_position = s.PositionName;
+ old_ocid = s.OcId.Value;
+ ret = new
+ {
+ CitizenId = profile.CitizenId,
+ Prefix = profile.Prefix,
+ FirstName = profile.FirstName,
+ LastName = profile.LastName,
+ DateOfBirth = profile.DateOfBirth,
+ RegistrationAddress = profile.RegistrationAddress,
+ SalaryAmount = profile.SalaryAmount,
+ Education = profile.Education,
+ AppointText = c == 1 ? "(เริ่มรับราชการ)" : "",
+ SalaryDate = s.SalaryDateAnnounce.Value.ToThaiShortDate(),
+ PositionName = s.PositionName,
+ OCFullPath = _profileService.GetOrganizationNameFullPath(s.OcId.Value, false, false)
+ };
+ data.Add(ret);
+ }
+ else if (old_ocid != s.OcId)
+ {
+ old_date = s.SalaryDateAnnounce.Value;
+ old_position = s.PositionName;
+ old_ocid = s.OcId.Value;
+ ret = new
+ {
+ CitizenId = profile.CitizenId,
+ Prefix = profile.Prefix,
+ FirstName = profile.FirstName,
+ LastName = profile.LastName,
+ DateOfBirth = profile.DateOfBirth,
+ RegistrationAddress = profile.RegistrationAddress,
+ SalaryAmount = profile.SalaryAmount,
+ Education = profile.Education,
+ AppointText = c == 1 ? "(เริ่มรับราชการ)" : "",
+ SalaryDate = s.SalaryDateAnnounce.Value.ToThaiShortDate(),
+ PositionName = s.PositionName,
+ OCFullPath = _profileService.GetOrganizationNameFullPath(s.OcId.Value, false, false)
+ };
+ data.Add(ret);
+ }
+
+ c++;
+ }
+
+ var rptFile = Path.Combine(_hostingEnvironment.ContentRootPath, "Report", "Profile", $"rptShortKp7.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 = data;
+ 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 content = result.DocumentBytes;
+ return File(content, "application/pdf", $"ประวัติการรับราชการอย่างย่อ_{data.First().CitizenId}.pdf");
+
+
+
+ }
+ catch (Exception ex)
+ {
+ return Error(ex, "ไม่สามารถแสดงผลรายงานได้!!!");
+ }
+ }
+
+
+ [HttpGet("kk1/{id:length(36)}")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status400BadRequest)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> GetKK1Report(Guid id)
+ {
+ try
+ {
+ var profile = (from p in _context.Profiles
+ join pf in _context.Prefixes on p.PrefixId equals pf.Id into p_pf_join
+ from p_pf in p_pf_join.DefaultIfEmpty()
+ join cpf in _context.Prefixes on p.CouplePrefixId equals cpf.Id into c_pf_join
+ from c_pf in c_pf_join.DefaultIfEmpty()
+ join fpf in _context.Prefixes on p.FatherPrefixId equals fpf.Id into f_pf_join
+ from f_pf in f_pf_join.DefaultIfEmpty()
+ join mpf in _context.Prefixes on p.MotherPrefixId equals mpf.Id into m_pf_join
+ from m_pf in m_pf_join.DefaultIfEmpty()
+ where p.Id == id
+ select new
+ {
+ p.CitizenId,
+ Prefix = p_pf == null ? "" : p_pf.Name,
+ p.FirstName,
+ p.LastName,
+ FullName = $"{p.FirstName} {p.LastName}",
+ BirthDay = p.BirthDate.Day,
+ BirthDayText = Convert.ToDecimal(p.BirthDate.Day).ThaiBahtText(UsesEt.Always, GreatFriends.ThaiBahtText.Unit.Baht, 2, false).Replace("บาท", ""),
+ BirthMonth = p.BirthDate.Month.ToThaiMonth(),
+ BirthYear = p.BirthDate.Year.ToThaiYear(),
+ BirthYearText = Convert.ToDecimal(p.BirthDate.Year.ToThaiYear()).ThaiBahtText(UsesEt.Always, GreatFriends.ThaiBahtText.Unit.Baht, 2, false).Replace("บาท", ""),
+ Address = "",
+ District = "",
+ Area = "",
+ Province = "",
+ Telephone = p.TelephoneNumber,
+ CouplePrefix = c_pf == null ? "" : c_pf.Name,
+ CoupleFullName = $"{p.CoupleFirstName} {p.CoupleLastName}".Trim(),
+ FatherPrefix = f_pf == null ? "" : f_pf.Name,
+ FatherFullName = $"{p.FatherFirstName} {p.FatherLastName}".Trim(),
+ MotherPrefix = m_pf == null ? "" : m_pf.Name,
+ MotherFullName = $"{p.MotherFirstName} {p.MotherLastName}".Trim(),
+ OcId = p.OcId,
+ OcFullPath = _profileService.GetOrganizationNameFullPath(p.OcId.Value, false, false),
+ Division = "",
+ Institute = "",
+ StartDate = p.DateStart == null ? "" : p.DateStart.Value.ToThaiShortDate(),
+ AppointDate = p.DateAppoint == null ? "" : p.DateAppoint.Value.ToThaiShortDate(),
+ BirthDate = p.BirthDate.ToThaiShortDate(),
+ RetireDate = p.BirthDate.CalculateRetireDate().ToThaiShortDate(),
+ }).ToList();
+
+ if (!profile.Any())
+ return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound);
+
+ // certificate
+ var cert = (from c in _context.ProfileCertificates.AsQueryable()
+ where c.Profile.Id == id
+ orderby c.IssueDate.Value.Year
+ select new
+ {
+ c.CertificateType,
+ c.Issuer,
+ c.CertificateNo,
+ IssueDate = c.IssueDate == null ? "" : c.IssueDate.Value.ToThaiShortDate()
+ }).ToList();
+
+ // add temp rows
+ while (cert.Count < 3)
+ {
+ cert.Add(new
+ {
+ CertificateType = "",
+ Issuer = "",
+ CertificateNo = "",
+ IssueDate = ""
+ });
+ }
+
+ // training
+ var training = (from t in _context.ProfileTrainings.AsQueryable()
+ where t.Profile.Id == id
+ orderby t.StartDate.Value.Year
+ select new
+ {
+ Institute = t.Host,
+ Start = t.StartDate == null ? "" : t.StartDate.Value.Year.ToThaiYear().ToString(),
+ End = t.EndDate == null ? "" : t.EndDate.Value.Year.ToThaiYear().ToString(),
+ Level = "",
+ Degree = t.Subject,
+ Field = ""
+ }).ToList();
+
+ while (training.Count < 3)
+ {
+ training.Add(new
+ {
+ Institute = "",
+ Start = "",
+ End = "",
+ Level = "",
+ Degree = "",
+ Field = ""
+ });
+ }
+
+ // disciplines
+ var discipline = (from d in _context.ProfileDisciplines.AsQueryable()
+ where d.Profile.Id == id
+ orderby d.Date.Value.Year
+ select new
+ {
+ DisciplineYear = d.Date == null ? "" : d.Date.Value.Year.ToThaiYear().ToString(),
+ DisciplineDetail = d.Detail,
+ RefNo = d.RefCommandNo
+ }).ToList();
+
+ while (discipline.Count < 3)
+ {
+ discipline.Add(new
+ {
+ DisciplineYear = "",
+ DisciplineDetail = "",
+ RefNo = ""
+ });
+ }
+
+ // education
+ var education = (from e in _context.ProfileEducations.AsQueryable()
+ where e.Profile.Id == id
+ orderby e.StartDate.Value.Year
+ select new
+ {
+ Institute = e.Institute,
+ Start = e.StartDate == null ? "" : e.StartDate.Value.Year.ToThaiYear().ToString(),
+ End = e.EndDate == null ? "" : e.EndDate.Value.Year.ToThaiYear().ToString(),
+ Level = e.EducationLevel,
+ Degree = e.Degree,
+ Field = e.Field.Trim() == "-" ? "" : e.Field
+ }).ToList();
+
+ while (education.Count < 4)
+ {
+ education.Add(new
+ {
+ Institute = "",
+ Start = "",
+ End = "",
+ Level = "",
+ Degree = "",
+ Field = ""
+ });
+ }
+
+
+
+
+
+
+
+ var rptFile = Path.Combine(_hostingEnvironment.ContentRootPath, "Report", "Profile", $"rptKK1_Page1.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 = profile;
+
+ // binding to table
+ var tblCertificate = (Telerik.Reporting.Table)report.Items["detailSection1"].Items["tblCertificate"];
+ tblCertificate.DataSource = cert;
+
+ var tblTraining = (Telerik.Reporting.Table)report.Items["detailSection1"].Items["tblTraining"];
+ tblTraining.DataSource = training;
+
+ var tblDiscipline = (Telerik.Reporting.Table)report.Items["detailSection1"].Items["tblDiscipline"];
+ tblDiscipline.DataSource = discipline;
+
+ var tblEducation = (Telerik.Reporting.Table)report.Items["detailSection1"].Items["tblEducation"];
+ tblEducation.DataSource = education;
+
+ try
+ {
+ // Get avatar Image
+ var picContent = (await _minioService.DownloadFileAsync(Guid.Parse("08db510a-a7cb-44ef-85c8-f5c214f87972"))).FileContent;
+ var pictureBox = (Telerik.Reporting.PictureBox)report.Items["pageFooterSection1"].Items["picAvatar"];
+ pictureBox.Value = Image.FromStream(new MemoryStream(picContent));
+ }
+ catch { }
+
+
+ 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);
+
+ // byte array waiting for merge pdf
+ var content = result.DocumentBytes;
+
+ // page2
+ var salary = (from s in _context.ProfileSalaries
+ join pos in _context.PositionPaths on s.PositionId equals pos.Id
+ join pos_no in _context.PositionNumbers on s.PosNoId equals pos_no.Id
+ join pos_lv in _context.PositionLevels on s.PositionLevelId equals pos_lv.Id
+ join pos_type in _context.PositionTypes on s.PositionTypeId equals pos_type.Id
+ where s.Profile.Id == id
+ orderby s.Date.Value
+ select new
+ {
+ SalaryDate = s.Date == null ? "" : s.Date == new DateTime(1, 1, 1) ? "" : s.Date.Value.ToThaiShortDate(),
+ Position = s.SalaryClass,
+ PosNo = pos_no.Name,
+ Rank = pos_lv.Name,
+ Salary = s.Amount == null ? "" : s.Amount.ToString().ToInteger().ToNumericText(),
+ RefAll = s.SalaryRef,
+ PositionType = pos_type.Name,
+ PositionLevel = pos_lv.Name,
+ PositionAmount = s.PositionSalaryAmount,
+ FullName = $"{s.Profile.FirstName} {s.Profile.LastName}",
+ OcFullPath = _profileService.GetOrganizationNameFullPath(s.Profile.OcId.Value, false, false),
+ }).ToList();
+
+ var rptFile2 = Path.Combine(_hostingEnvironment.ContentRootPath, "Report", "Profile", $"rptKK1_Page2.trdp");
+
+ ReportPackager reportPackager2 = new ReportPackager();
+ Telerik.Reporting.Report? report2 = null;
+ using (var sourceStream = System.IO.File.OpenRead(rptFile2))
+ {
+ report2 = (Telerik.Reporting.Report)reportPackager.UnpackageDocument(sourceStream);
+ }
+ report2.DataSource = salary;
+ // binding to table
+ var tblSalary = (Telerik.Reporting.Table)report2.Items["detailSection1"].Items["tblSalary"];
+ tblSalary.DataSource = salary;
+
+ System.Collections.Hashtable deviceInfo2 = new System.Collections.Hashtable();
+
+ InstanceReportSource instanceReportSource2 = new InstanceReportSource()
+ {
+ ReportDocument = report2
+ };
+
+
+ ReportProcessor reportProcessor2 = new ReportProcessor(_configuration);
+ RenderingResult result2 = reportProcessor2.RenderReport("PDF", instanceReportSource2, deviceInfo2);
+
+ // byte array waiting for merge pdf
+ var content2 = result2.DocumentBytes;
+
+ // merge pdf
+ using (MemoryStream ms = new MemoryStream())
+ {
+ using (PdfDocument pdf = new PdfDocument(new PdfWriter(ms).SetSmartMode(true)))
+ {
+ // Create reader from bytes
+ using (MemoryStream memoryStream = new MemoryStream(content))
+ {
+ // Create reader from bytes
+ using (PdfReader reader = new PdfReader(memoryStream))
+ {
+ PdfDocument srcDoc = new PdfDocument(reader);
+ srcDoc.CopyPagesTo(1, srcDoc.GetNumberOfPages(), pdf);
+ }
+ }
+
+ // Create reader from bytes
+ using (MemoryStream memoryStream = new MemoryStream(content2))
+ {
+ // Create reader from bytes
+ using (PdfReader reader = new PdfReader(memoryStream))
+ {
+ PdfDocument srcDoc = new PdfDocument(reader);
+ srcDoc.CopyPagesTo(1, srcDoc.GetNumberOfPages(), pdf);
+ }
+ }
+
+ pdf.Close();
+ }
+
+ var fileContent = ms.ToArray();
+ return File(fileContent, "application/pdf", $"กก_1_{id}.pdf");
+ }
+ }
+ catch (Exception ex)
+ {
+ return Error(ex);
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/Core/GlobalMessages.cs b/Core/GlobalMessages.cs
new file mode 100644
index 0000000..30057cf
--- /dev/null
+++ b/Core/GlobalMessages.cs
@@ -0,0 +1,11 @@
+namespace BMA.EHR.Recruit.Service.Core
+{
+ public class GlobalMessages
+ {
+ public const string FileNotFoundOnServer = "ไม่พบไฟล์ในระบบ!!";
+ public const string CannotInsertToDatabase = "ไม่สามารถบันทึกลงฐานข้อมูลได้!!";
+ public const string InvalidRequestParam = "Request parameter ไม่ถูกต้อง!!";
+ public const string NoFileToUpload = "ไม่พบไฟล์เพื่อทำการอัพโหลด";
+ public const string DataNotFound = "ไม่พบข้อมูลในระบบ";
+ }
+}
diff --git a/Data/ApplicationDbContext.cs b/Data/ApplicationDbContext.cs
index 78f6a1a..b6ded4b 100644
--- a/Data/ApplicationDbContext.cs
+++ b/Data/ApplicationDbContext.cs
@@ -1,4 +1,7 @@
-using BMA.EHR.Recruit.Service.Models.Documents;
+using BMA.EHR.MetaData.Service.Models;
+using BMA.EHR.Profile.Service.Models;
+using BMA.EHR.Profile.Service.Models.HR;
+using BMA.EHR.Recruit.Service.Models.Documents;
using BMA.EHR.Recruit.Service.Models.Recruits;
using Microsoft.EntityFrameworkCore;
@@ -52,5 +55,7 @@ namespace BMA.EHR.Report.Service.Data
public DbSet RecruitDocuments { get; set; }
public DbSet RecruitImportHistories { get; set; }
- }
+
+
+ }
}
diff --git a/Data/EHRDbContext.cs b/Data/EHRDbContext.cs
new file mode 100644
index 0000000..9abfbfb
--- /dev/null
+++ b/Data/EHRDbContext.cs
@@ -0,0 +1,225 @@
+using BMA.EHR.MetaData.Service.Models;
+using BMA.EHR.Profile.Service.Models;
+using BMA.EHR.Profile.Service.Models.HR;
+using BMA.EHR.Recruit.Service.Models.Documents;
+using BMA.EHR.Recruit.Service.Models.Recruits;
+using Microsoft.EntityFrameworkCore;
+
+namespace BMA.EHR.Report.Service.Data
+{
+ public class EHRDbContext : DbContext
+ {
+ public EHRDbContext(DbContextOptions options)
+ : base(options)
+ {
+ }
+
+ protected override void OnModelCreating(ModelBuilder modelBuilder)
+ {
+ //base.OnModelCreating(modelBuilder);
+
+ //modelBuilder.Ignore();
+ //modelBuilder.Ignore();
+ //modelBuilder.Ignore();
+ //modelBuilder.Ignore();
+ //modelBuilder.Ignore();
+ //modelBuilder.Ignore();
+ //modelBuilder.Ignore();
+ //modelBuilder.Ignore();
+ //modelBuilder.Ignore();
+ //modelBuilder.Ignore();
+ //modelBuilder.Ignore();
+ //modelBuilder.Ignore();
+ }
+
+ public DbSet Documents { get; set; }
+
+ #region " From Existing DB "
+
+ public DbSet AvailablePositionLevels { get; set; }
+
+ public DbSet PositionMasters { get; set; }
+
+ public DbSet Organizations { get; set; }
+
+ public DbSet PositionNumbers { get; set; }
+
+ public DbSet OrganizationPositions { get; set; }
+
+ public DbSet Prefixes { get; set; }
+
+ public DbSet BloodGroups { get; set; }
+
+ public DbSet Genders { get; set; }
+
+ public DbSet PhysicalStatuses { get; set; }
+
+ public DbSet Religions { get; set; }
+
+ public DbSet EducationLevels { get; set; }
+
+ public DbSet PositionPaths { get; set; }
+
+ public DbSet PositionTypes { get; set; }
+
+ public DbSet PositionEmployeePositions { get; set; }
+
+ public DbSet PositionEmployeePositionSides { get; set; }
+
+ public DbSet PositionEmployeeGroups { get; set; }
+
+ public DbSet PositionEmployeeLines { get; set; }
+
+ public DbSet PositionEmployeeLevels { get; set; }
+
+ public DbSet PositionEmployeeStatuses { get; set; }
+
+ public DbSet PositionLines { get; set; }
+
+ public DbSet PositionExecutives { get; set; }
+
+ public DbSet PositionStatuss { get; set; }
+
+ public DbSet PositionLevels { get; set; }
+
+ public DbSet Relationships { get; set; }
+
+ public DbSet Positions { get; set; }
+
+ public DbSet PositionPathSides { get; set; }
+
+ public DbSet PositionExecutiveSides { get; set; }
+
+ public DbSet InsigniaTypes { get; set; }
+
+ public DbSet Insignias { get; set; }
+
+ public DbSet Provinces { get; set; }
+
+ public DbSet Districts { get; set; }
+
+ public DbSet SubDistricts { get; set; }
+
+ public DbSet Holidays { get; set; }
+
+ public DbSet OrganizationTypes { get; set; }
+
+ public DbSet OrganizationLevels { get; set; }
+
+ public DbSet OrganizationOrganizations { get; set; }
+
+ public DbSet OrganizationShortNames { get; set; }
+
+ public DbSet OrganizationStatuses { get; set; }
+
+ public DbSet OrganizationAgencys { get; set; }
+
+ public DbSet OrganizationGovernmentAgencys { get; set; }
+
+ public DbSet OrganizationTelExternals { get; set; }
+
+ public DbSet OrganizationTelInternals { get; set; }
+
+ public DbSet OrganizationFaxs { get; set; }
+
+ public DbSet RoyalHierarchys { get; set; }
+
+ public DbSet RoyalTypes { get; set; }
+
+ public DbSet Royals { get; set; }
+
+ #endregion
+
+ public DbSet Profiles { get; set; }
+
+ public DbSet ProfileEducations { get; set; }
+
+ public DbSet ProfileEducationHistorys { get; set; }
+
+ public DbSet ProfileHonors { get; set; }
+
+ public DbSet ProfileHonorHistorys { get; set; }
+
+ public DbSet ProfileAssessments { get; set; }
+
+ public DbSet ProfileAssessmentHistorys { get; set; }
+
+ public DbSet ProfileDisciplines { get; set; }
+
+ public DbSet ProfileDisciplineHistorys { get; set; }
+
+ public DbSet ProfileCertificates { get; set; }
+
+ public DbSet ProfileCertificateHistorys { get; set; }
+
+ public DbSet ProfileTrainings { get; set; }
+
+ public DbSet ProfileTrainingHistorys { get; set; }
+
+ public DbSet ProfileInsignias { get; set; }
+
+ public DbSet ProfileInsigniaHistorys { get; set; }
+
+ public DbSet ProfileSalaries { get; set; }
+
+ public DbSet ProfileSalaryHistories { get; set; }
+
+ public DbSet ProfileSalaryOrganizations { get; set; }
+
+ public DbSet ProfileSalaryPositions { get; set; }
+
+ public DbSet ProfileSalaryPositionsNumbers { get; set; }
+
+ public DbSet ProfileHistory { get; set; }
+
+ public DbSet ProfileCoupleHistory { get; set; }
+
+ public DbSet ProfileFatherHistory { get; set; }
+
+ public DbSet ProfileMotherHistory { get; set; }
+
+ public DbSet ProfileFamilyHistory { get; set; }
+
+ public DbSet ProfileGovernmentHistory { get; set; }
+
+ public DbSet ProfileLeaves { get; set; }
+
+ public DbSet ProfileLeaveHistorys { get; set; }
+
+ public DbSet ProfileSalaryPositionLevels { get; set; }
+
+ public DbSet ProfileSalaryPositionTypes { get; set; }
+
+ public DbSet ProfileChildrens { get; set; }
+
+ public DbSet ProfileChildrenHistories { get; set; }
+
+ public DbSet ProfilePapers { get; set; }
+
+ public DbSet ProfileCurrentAddressHistories { get; set; }
+
+ public DbSet ProfileRegistrationAddressHistories { get; set; }
+
+ public DbSet ProfileAddressHistories { get; set; }
+
+ public DbSet ProfileOthers { get; set; }
+
+ public DbSet ProfileOtherHistorys { get; set; }
+
+ public DbSet ProfileAbilitys { get; set; }
+
+ public DbSet ProfileAbilityHistorys { get; set; }
+
+ public DbSet ProfileDutys { get; set; }
+
+ public DbSet ProfileDutyHistorys { get; set; }
+
+ public DbSet ProfileNopaids { get; set; }
+
+ public DbSet ProfileNopaidHistorys { get; set; }
+
+ public DbSet ProfileAvatarHistories { get; set; }
+
+ public DbSet ProfilePositions { get; set; }
+ }
+}
diff --git a/Data/ExamDbContext.cs b/Data/ExamDbContext.cs
new file mode 100644
index 0000000..19e8268
--- /dev/null
+++ b/Data/ExamDbContext.cs
@@ -0,0 +1,79 @@
+using BMA.EHR.Recruit.Service.Models.Documents;
+using BMA.EHR.Recurit.Exam.Service.Models;
+using BMA.EHR.Recurit.Exam.Service.Models.Disables;
+using Microsoft.EntityFrameworkCore;
+
+namespace BMA.EHR.Report.Service.Data
+{
+ public class ExamDbContext : DbContext
+ {
+ public ExamDbContext(DbContextOptions options)
+ : base(options)
+ {
+ }
+
+ protected override void OnModelCreating(ModelBuilder modelBuilder)
+ {
+ //base.OnModelCreating(modelBuilder);
+
+ //modelBuilder.Ignore();
+ //modelBuilder.Ignore();
+ //modelBuilder.Ignore();
+ //modelBuilder.Ignore();
+ //modelBuilder.Ignore();
+ //modelBuilder.Ignore();
+ //modelBuilder.Ignore();
+ //modelBuilder.Ignore();
+ //modelBuilder.Ignore();
+ //modelBuilder.Ignore();
+ //modelBuilder.Ignore();
+ //modelBuilder.Ignore();
+ }
+
+ public DbSet PeriodExams { get; set; }
+
+ public DbSet Candidates { get; set; }
+
+ public DbSet Careers { get; set; }
+
+ public DbSet Educations { get; set; }
+
+ public DbSet Documents { get; set; }
+
+ public DbSet CandidateDocuments { get; set; }
+
+ public DbSet PositionExams { get; set; }
+
+ public DbSet BankExams { get; set; }
+
+ public DbSet PeriodExamDocuments { get; set; }
+
+ public DbSet PeriodExamImages { get; set; }
+
+ public DbSet CMSCandidates { get; set; }
+
+ public DbSet CMSAgencys { get; set; }
+
+ public DbSet CMSGovernments { get; set; }
+
+ public DbSet Disables { get; set; }
+
+ public DbSet DisableAddresses { get; set; }
+
+ public DbSet DisableOccupations { get; set; }
+
+ public DbSet DisableCertificates { get; set; }
+
+ public DbSet DisableEducations { get; set; }
+
+ public DbSet ScoreImports { get; set; }
+
+ public DbSet DisableScores { get; set; }
+
+ public DbSet DisablePayments { get; set; }
+
+ public DbSet DisableDocuments { get; set; }
+
+ public DbSet DisableImportHistories { get; set; }
+ }
+}
diff --git a/Models/AvailablePositionLevelEntity.cs b/Models/AvailablePositionLevelEntity.cs
new file mode 100644
index 0000000..b797d9d
--- /dev/null
+++ b/Models/AvailablePositionLevelEntity.cs
@@ -0,0 +1,25 @@
+
+using BMA.EHR.Report.Service.Models;
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace BMA.EHR.Profile.Service.Models
+{
+ public class AvailablePositionLevelEntity : EntityBase
+ {
+
+ [ForeignKey("PositionMasterId")]
+ public PositionMasterEntity? PositionMaster_PositionMasterId { get; set; }
+
+ [Column(Order = 2), Comment("PositionMasterId")]
+ public Guid? PositionMasterId { get; set; }
+
+ [Column(Order = 3), Comment("PositionLevelId")]
+ public Guid? PositionLevelId { get; set; }
+
+
+
+
+ }
+}
diff --git a/Models/Exam/BankExam.cs b/Models/Exam/BankExam.cs
new file mode 100644
index 0000000..71d447a
--- /dev/null
+++ b/Models/Exam/BankExam.cs
@@ -0,0 +1,20 @@
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations;
+
+namespace BMA.EHR.Recurit.Exam.Service.Models
+{
+ public class BankExam : EntityBase
+ {
+ [Required, Comment("Id การสอบ")]
+ public virtual PeriodExam? PeriodExam { get; set; }
+
+ [Comment("เลขบัญชี")]
+ public string? AccountNumber { get; set; }
+
+ [Comment("ธนาคาร")]
+ public string? BankName { get; set; }
+
+ [Comment("ชื่อบัญชี")]
+ public string? AccountName { get; set; }
+ }
+}
diff --git a/Models/Exam/CMSAgency.cs b/Models/Exam/CMSAgency.cs
new file mode 100644
index 0000000..c017a70
--- /dev/null
+++ b/Models/Exam/CMSAgency.cs
@@ -0,0 +1,17 @@
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations;
+
+namespace BMA.EHR.Recurit.Exam.Service.Models
+{
+ public class CMSAgency : EntityBase
+ {
+ [Required, Comment("Id CMS")]
+ public virtual CMSCandidate? CMSCandidate { get; set; }
+
+ [Comment("ชื่อลิงค์")]
+ public string? Name { get; set; }
+
+ [Comment("ลิงค์")]
+ public string? Link { get; set; }
+ }
+}
diff --git a/Models/Exam/CMSCandidate.cs b/Models/Exam/CMSCandidate.cs
new file mode 100644
index 0000000..f2dce56
--- /dev/null
+++ b/Models/Exam/CMSCandidate.cs
@@ -0,0 +1,64 @@
+using BMA.EHR.Recruit.Service.Models.Documents;
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations;
+
+namespace BMA.EHR.Recurit.Exam.Service.Models
+{
+ public class CMSCandidate : EntityBase
+ {
+
+ [Comment("Id โลโก้เว็บ")]
+ public virtual Document? LogoImg { get; set; }
+
+ [Comment("Id Banner")]
+ public virtual Document? BannerImg { get; set; }
+
+
+ [Comment("ชื่อเว็บภาษาไทย")]
+ public string? NameTh { get; set; }
+
+ [Comment("ชื่อย่อ")]
+ public string? ShortName { get; set; }
+
+ [Comment("ชื่อเว็บภาษาอังกฤษ")]
+ public string? NameEn { get; set; }
+
+ [Comment("ข้อมูลเว็บโดยย่อ")]
+ public string? Description { get; set; }
+
+
+ [Comment("ข้อมูลเกี่ยวกับเรา")]
+ public string? About { get; set; }
+
+ [Comment("ที่อยู่ปัจจุบัน")]
+ public string? Address { get; set; }
+
+ [Comment("Id จังหวัด")]
+ public Guid? ProvinceId { get; set; }
+
+ [Comment("จังหวัด")]
+ public string? ProvinceName { get; set; }
+
+ [Comment("Id อำเภอ")]
+ public Guid? DistrictId { get; set; }
+
+ [Comment("อำเภอ")]
+ public string? DistrictName { get; set; }
+
+ [Comment("Id ตำบล")]
+ public Guid? SubDistrictId { get; set; }
+
+ [Comment("ตำบล")]
+ public string? SubDistrictName { get; set; }
+
+ [MaxLength(10), Comment("รหัสไปรษณีย์")]
+ public string? ZipCode { get; set; }
+
+ [MaxLength(20), Comment("โทรศัพท์")]
+ public string? Telephone { get; set; }
+
+ public List CMSAgencys { get; set; } = new List();
+
+ public List CMSGovernments { get; set; } = new List();
+ }
+}
diff --git a/Models/Exam/CMSGovernment.cs b/Models/Exam/CMSGovernment.cs
new file mode 100644
index 0000000..d946fca
--- /dev/null
+++ b/Models/Exam/CMSGovernment.cs
@@ -0,0 +1,17 @@
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations;
+
+namespace BMA.EHR.Recurit.Exam.Service.Models
+{
+ public class CMSGovernment : EntityBase
+ {
+ [Required, Comment("Id CMS")]
+ public virtual CMSCandidate? CMSCandidate { get; set; }
+
+ [Comment("ชื่อลิงค์")]
+ public string? Name { get; set; }
+
+ [Comment("ลิงค์")]
+ public string? Link { get; set; }
+ }
+}
diff --git a/Models/Exam/Candidate.cs b/Models/Exam/Candidate.cs
new file mode 100644
index 0000000..3dfed1e
--- /dev/null
+++ b/Models/Exam/Candidate.cs
@@ -0,0 +1,256 @@
+using BMA.EHR.Recruit.Service.Models.Documents;
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace BMA.EHR.Recurit.Exam.Service.Models
+{
+ public class Candidate : EntityBase
+ {
+ [Required, Comment("Id การสอบ")]
+ public virtual PeriodExam? PeriodExam { get; set; }
+
+ [Comment("Id ตำแหน่งสอบ")]
+ public virtual PositionExam? PositionExam { get; set; }
+
+ [Required, MaxLength(40), Comment("User Id ผู้สมัคร")]
+ public string UserId { get; set; } = string.Empty;
+
+ [Required, MaxLength(20), Comment("สถานะผู้สมัคร")]
+ public string Status { get; set; } = "register";
+
+ [Comment("เลขประจำตัวสอบ")]
+ public string? ExamIdenNumber { get; set; }
+
+ [Comment("เลขที่นั่งสอบ")]
+ public string? SeatNumber { get; set; }
+
+ [Comment("คะแนนเต็มภาค ข")]
+ public string? PointTotalB { get; set; }
+
+ [Comment("คะแนนภาค ข")]
+ public string? PointB { get; set; }
+
+ [Comment("ผลสอบภาค ข")]
+ public string? ResultB { get; set; }
+
+ [Comment("คะแนนเต็มภาค ค")]
+ public string? PointTotalC { get; set; }
+
+ [Comment("คะแนนภาค ค")]
+ public string? PointC { get; set; }
+
+ [Comment("ผลสอบภาค ค")]
+ public string? ResultC { get; set; }
+
+ [Comment("Id รูปโปรไฟล์")]
+ public virtual Document? ProfileImg { get; set; }
+
+ [Comment("Id หลักฐานชำระเงิน")]
+ public virtual Document? PaymentImg { get; set; }
+
+ [Comment("ลำดับที่สอบได้")]
+ public string? Number { get; set; }
+
+
+ [Comment("Id คำนำหน้าชื่อ")]
+ public Guid? PrefixId { get; set; }
+
+ [Comment("คำนำหน้าชื่อ")]
+ public string? PrefixName { get; set; }
+
+ [MaxLength(100), Column(Order = 1), Comment("ชื่อจริง")]
+ public string? FirstName { get; set; }
+
+ [MaxLength(100), Column(Order = 2), Comment("นามสกุล")]
+ public string? LastName { get; set; }
+
+ [MaxLength(40), Column(Order = 3), Comment("สัญชาติ")]
+ public string? Nationality { get; set; }
+
+ [MaxLength(40), Comment("วันเกิด")]
+ public DateTime? DateOfBirth { get; set; }
+
+ [Comment("Id สถานภาพ")]
+ public Guid? RelationshipId { get; set; }
+
+ [Comment("สถานภาพ")]
+ public string? RelationshipName { get; set; }
+
+ [MaxLength(200), Comment("อีเมล")]
+ public string? Email { get; set; }
+
+ [MaxLength(20), Comment("เลขประจำตัวประชาชน")]
+ public string? CitizenId { get; set; }
+
+ [Comment("Id เขตที่ออกบัตรประชาชน")]
+ public Guid? CitizenDistrictId { get; set; }
+
+ [Comment("เขตที่ออกบัตรประชาชน")]
+ public string? CitizenDistrictName { get; set; }
+
+ [Comment("Id จังหวัดที่ออกบัตรประชาชน")]
+ public Guid? CitizenProvinceId { get; set; }
+
+ [Comment("จังหวัดที่ออกบัตรประชาชน")]
+ public string? CitizenProvinceName { get; set; }
+
+ [Comment("วันที่ออกบัตร")]
+ public DateTime? CitizenDate { get; set; }
+
+ [MaxLength(20), Comment("โทรศัพท์")]
+ public string? Telephone { get; set; }
+
+ [MaxLength(20), Comment("โทรศัพท์มือถือ")]
+ public string? MobilePhone { get; set; }
+
+ [Comment("ความสามารถพิเศษ")]
+ public string? Knowledge { get; set; }
+
+
+
+
+ [Comment("ที่อยู่ตามทะเบียนบ้าน")]
+ public string? RegistAddress { get; set; }
+
+ [Comment("Id จังหวัดที่อยู่ตามทะเบียนบ้าน")]
+ public Guid? RegistProvinceId { get; set; }
+
+ [Comment("จังหวัดที่อยู่ตามทะเบียนบ้าน")]
+ public string? RegistProvinceName { get; set; }
+
+ [Comment("Id อำเภอที่อยู่ตามทะเบียนบ้าน")]
+ public Guid? RegistDistrictId { get; set; }
+
+ [Comment("อำเภอที่อยู่ตามทะเบียนบ้าน")]
+ public string? RegistDistrictName { get; set; }
+
+ [Comment("Id ตำบลที่อยู่ตามทะเบียนบ้าน")]
+ public Guid? RegistSubDistrictId { get; set; }
+
+ [Comment("ตำบลที่อยู่ตามทะเบียนบ้าน")]
+ public string? RegistSubDistrictName { get; set; }
+
+ [MaxLength(10), Comment("รหัสไปรษณีย์ที่อยู่ตามทะเบียนบ้าน")]
+ public string? RegistZipCode { get; set; }
+
+ [Comment("ที่อยู่ปัจจุบันเหมือนที่อยู่ตามทะเบียนบ้าน")]
+ public bool? RegistSame { get; set; }
+
+ [Comment("ที่อยู่ปัจจุบัน")]
+ public string? CurrentAddress { get; set; }
+
+ [Comment("Id จังหวัดที่อยู่ปัจจุบัน")]
+ public Guid? CurrentProvinceId { get; set; }
+
+ [Comment("จังหวัดที่อยู่ปัจจุบัน")]
+ public string? CurrentProvinceName { get; set; }
+
+ [Comment("Id อำเภอที่อยู่ปัจจุบัน")]
+ public Guid? CurrentDistrictId { get; set; }
+
+ [Comment("อำเภอที่อยู่ปัจจุบัน")]
+ public string? CurrentDistrictName { get; set; }
+
+ [Comment("Id ตำบลที่อยู่ปัจจุบัน")]
+ public Guid? CurrentSubDistrictId { get; set; }
+
+ [Comment("ตำบลที่อยู่ปัจจุบัน")]
+ public string? CurrentSubDistrictName { get; set; }
+
+ [MaxLength(10), Comment("รหัสไปรษณีย์ที่อยู่ปัจจุบัน")]
+ public string? CurrentZipCode { get; set; }
+
+
+
+ [Comment("คู่สมรส")]
+ public bool? Marry { get; set; }
+
+ [Comment("Id คำนำหน้าชื่อคู่สมรส")]
+ public Guid? MarryPrefixId { get; set; }
+
+ [Comment("คำนำหน้าชื่อคู่สมรส")]
+ public string? MarryPrefixName { get; set; }
+
+ [MaxLength(100), Comment("ชื่อจริงคู่สมรส")]
+ public string? MarryFirstName { get; set; }
+
+ [MaxLength(100), Comment("นามสกุลคู่สมรส")]
+ public string? MarryLastName { get; set; }
+
+ [MaxLength(200), Comment("อาชีพคู่สมรส")]
+ public string? MarryOccupation { get; set; }
+
+ [MaxLength(100), Comment("สัญชาติคู่สมรส")]
+ public string? MarryNationality { get; set; }
+
+ [Comment("Id คำนำหน้าชื่อบิดา")]
+ public Guid? FatherPrefixId { get; set; }
+
+ [Comment("คำนำหน้าชื่อบิดา")]
+ public string? FatherPrefixName { get; set; }
+
+ [MaxLength(100), Comment("ชื่อจริงบิดา")]
+ public string? FatherFirstName { get; set; }
+
+ [MaxLength(100), Comment("นามสกุลบิดา")]
+ public string? FatherLastName { get; set; }
+
+ [MaxLength(200), Comment("อาชีพบิดา")]
+ public string? FatherOccupation { get; set; }
+
+ [MaxLength(100), Comment("สัญชาติบิดา")]
+ public string? FatherNationality { get; set; }
+
+ [Comment("Id คำนำหน้าชื่อมารดา")]
+ public Guid? MotherPrefixId { get; set; }
+
+ [Comment("คำนำหน้าชื่อมารดา")]
+ public string? MotherPrefixName { get; set; }
+
+ [MaxLength(100), Comment("ชื่อจริงมารดา")]
+ public string? MotherFirstName { get; set; }
+
+ [MaxLength(100), Comment("นามสกุลมารดา")]
+ public string? MotherLastName { get; set; }
+
+ [MaxLength(200), Comment("อาชีพมารดา")]
+ public string? MotherOccupation { get; set; }
+
+ [MaxLength(100), Comment("สัญชาติมารดา")]
+ public string? MotherNationality { get; set; }
+
+
+
+ [Comment("ประเภทอาชีพที่ทำงานมาก่อน")]
+ public string? OccupationType { get; set; }
+
+ [Comment("ตำแหน่งอาชีพ")]
+ public string? OccupationPosition { get; set; }
+
+ [Comment("สำนัก/บริษัท บริษัท")]
+ public string? OccupationCompany { get; set; }
+
+ [Comment("กอง/ฝ่าย บริษัท")]
+ public string? OccupationDepartment { get; set; }
+
+ [MaxLength(200), Comment("อีเมล บริษัท")]
+ public string? OccupationEmail { get; set; }
+
+ [MaxLength(20), Comment("โทรศัพท์ บริษัท")]
+ public string? OccupationTelephone { get; set; }
+
+ [Comment("เหตุผลการไม่อนุมัติ")]
+ public string? RejectDetail { get; set; }
+
+ [Comment("ผลสมัครสอบ")]
+ public string? Pass { get; set; }
+
+ [Comment("คะแนนความพึงพอใจ")]
+ public int? ReviewPoint { get; set; }
+
+ [Comment("ข้อแนะนำ")]
+ public string? Review { get; set; }
+
+ }
+}
diff --git a/Models/Exam/CandidateDocument.cs b/Models/Exam/CandidateDocument.cs
new file mode 100644
index 0000000..00270b1
--- /dev/null
+++ b/Models/Exam/CandidateDocument.cs
@@ -0,0 +1,16 @@
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.ComponentModel.DataAnnotations;
+using BMA.EHR.Recruit.Service.Models.Documents;
+
+namespace BMA.EHR.Recurit.Exam.Service.Models
+{
+ public class CandidateDocument : EntityBase
+ {
+ [Required, Comment("Id ผู้สมัครสอบ")]
+ public virtual Candidate? Candidate { get; set; }
+
+ [Required, Comment("Id ไฟล์เอกสาร")]
+ public virtual Document? Document { get; set; }
+ }
+}
diff --git a/Models/Exam/Career.cs b/Models/Exam/Career.cs
new file mode 100644
index 0000000..c4561e0
--- /dev/null
+++ b/Models/Exam/Career.cs
@@ -0,0 +1,30 @@
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.ComponentModel.DataAnnotations;
+
+namespace BMA.EHR.Recurit.Exam.Service.Models
+{
+ public class Career : EntityBase
+ {
+ [Required, Column(Order = 7), Comment("Id ผู้สมัคร")]
+ public virtual Candidate? Candidate { get; set; }
+
+ [Required, Column(Order = 3), Comment("สถานที่ทำงาน/ฝึกงาน")]
+ public string Name { get; set; } = string.Empty;
+
+ [Required, Column(Order = 4), Comment("ตำแหน่ง/ลักษณะงาน")]
+ public string Position { get; set; } = string.Empty;
+
+ [Required, MaxLength(20), Column(Order = 5), Comment("เงินเดือนสุดท้ายก่อนออก")]
+ public int Salary { get; set; }
+
+ [Required, Column(Order = 1), Comment("ระยะเวลาเริ่ม")]
+ public DateTime DurationStart { get; set; } = DateTime.Now.Date;
+
+ [Required, Column(Order = 2), Comment("ระยะเวลาสิ้นสุด")]
+ public DateTime DurationEnd { get; set; } = DateTime.Now.Date;
+
+ [Required, Column(Order = 6), Comment("เหตุผลที่ออก")]
+ public string Reason { get; set; } = string.Empty;
+ }
+}
diff --git a/Models/Exam/Disable/Disable.cs b/Models/Exam/Disable/Disable.cs
new file mode 100644
index 0000000..4d789ae
--- /dev/null
+++ b/Models/Exam/Disable/Disable.cs
@@ -0,0 +1,82 @@
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace BMA.EHR.Recurit.Exam.Service.Models.Disables
+{
+ public class Disable : EntityBase
+ {
+
+ [Required, MaxLength(13), Comment("เลขประจำตัวประชาชน")]
+ public string CitizenId { get; set; } = string.Empty;
+
+ [Required, MaxLength(50)]
+ public string ExamId { get; set; } = string.Empty;
+
+ [Required, MaxLength(50)]
+ public string Prefix { get; set; } = string.Empty;
+
+ [Required, MaxLength(150)]
+ public string FirstName { get; set; } = string.Empty;
+
+ [Required, MaxLength(150)]
+ public string LastName { get; set; } = string.Empty;
+
+ [MaxLength(20)]
+ public string Gendor { get; set; } = string.Empty;
+
+ [MaxLength(200)]
+ public string National { get; set; } = string.Empty;
+
+ [MaxLength(200)]
+ public string Race { get; set; } = string.Empty;
+
+ [MaxLength(200)]
+ public string Religion { get; set; } = string.Empty;
+
+ [Required]
+ public DateTime DateOfBirth { get; set; }
+
+ [MaxLength(20)]
+ public string Marry { get; set; } = string.Empty;
+
+ [MaxLength(1)]
+ public string Isspecial { get; set; } = "N";
+
+ [MaxLength(20)]
+ public string RefNo { get; set; } = string.Empty;
+
+ [MaxLength(200)]
+ public string CitizenCardIssuer { get; set; } = string.Empty;
+
+ public DateTime CitizenCardExpireDate { get; set; }
+
+ [MaxLength(200)]
+ public string Remark { get; set; } = string.Empty;
+
+ [MaxLength(1)]
+ public string Qualified { get; set; } = "Y";
+
+ public PeriodExam? PeriodExam { get; set; }
+
+ public virtual List Addresses { get; set; } = new List();
+
+ public virtual List Occupations { get; set; } = new List();
+
+ public virtual List Certificates { get; set; } = new List();
+
+ public virtual List Educations { get; set; } = new List();
+
+ public virtual List Payments { get; set; } = new List();
+
+ public virtual List Documents { get; set; } = new List();
+
+ public DateTime CreatedDate { get; set; } = DateTime.Now;
+
+ public DateTime ModifiedDate { get; set; }
+
+ public DateTime ApplyDate { get; set; }
+
+ public string? PositionName { get; set; }
+ }
+}
diff --git a/Models/Exam/Disable/DisableAddress.cs b/Models/Exam/Disable/DisableAddress.cs
new file mode 100644
index 0000000..2d746ec
--- /dev/null
+++ b/Models/Exam/Disable/DisableAddress.cs
@@ -0,0 +1,63 @@
+using System.ComponentModel.DataAnnotations;
+
+namespace BMA.EHR.Recurit.Exam.Service.Models.Disables
+{
+ public class DisableAddress : EntityBase
+ {
+ [MaxLength(200)]
+ public string Address { get; set; }
+
+ [MaxLength(200)]
+ public string Moo { get; set; }
+
+ [MaxLength(200)]
+ public string Soi { get; set; }
+
+ [MaxLength(200)]
+ public string Road { get; set; }
+
+ [MaxLength(200)]
+ public string District { get; set; }
+
+ [MaxLength(200)]
+ public string Amphur { get; set; }
+
+ [MaxLength(200)]
+ public string Province { get; set; }
+
+ [MaxLength(5)]
+ public string ZipCode { get; set; }
+
+ [MaxLength(200)]
+ public string Telephone { get; set; }
+
+ [MaxLength(200)]
+ public string Mobile { get; set; }
+
+ [MaxLength(200)]
+ public string Address1 { get; set; }
+
+ [MaxLength(200)]
+ public string Moo1 { get; set; }
+
+ [MaxLength(200)]
+ public string Soi1 { get; set; }
+
+ [MaxLength(200)]
+ public string Road1 { get; set; }
+
+ [MaxLength(200)]
+ public string District1 { get; set; }
+
+ [MaxLength(200)]
+ public string Amphur1 { get; set; }
+
+ [MaxLength(200)]
+ public string Province1 { get; set; }
+
+ [MaxLength(5)]
+ public string ZipCode1 { get; set; }
+
+ public Disable Disable { get; set; }
+ }
+}
diff --git a/Models/Exam/Disable/DisableCertificate.cs b/Models/Exam/Disable/DisableCertificate.cs
new file mode 100644
index 0000000..b1108ac
--- /dev/null
+++ b/Models/Exam/Disable/DisableCertificate.cs
@@ -0,0 +1,19 @@
+using System.ComponentModel.DataAnnotations;
+
+namespace BMA.EHR.Recurit.Exam.Service.Models.Disables
+{
+ public class DisableCertificate : EntityBase
+ {
+ [MaxLength(50)]
+ public string CertificateNo { get; set; }
+
+ [MaxLength(200)]
+ public string Description { get; set; }
+
+ public DateTime IssueDate { get; set; }
+
+ public DateTime ExpiredDate { get; set; }
+
+ public Disable Disable { get; set; }
+ }
+}
diff --git a/Models/Exam/Disable/DisableDocument.cs b/Models/Exam/Disable/DisableDocument.cs
new file mode 100644
index 0000000..a3dfa82
--- /dev/null
+++ b/Models/Exam/Disable/DisableDocument.cs
@@ -0,0 +1,13 @@
+using BMA.EHR.Recruit.Service.Models.Documents;
+
+namespace BMA.EHR.Recurit.Exam.Service.Models.Disables
+{
+ public class DisableDocument : EntityBase
+ {
+ public DateTime CreatedDate { get; set; }
+
+ public Document DocumentFile { get; set; }
+
+ public Disable Disable { get; set; }
+ }
+}
diff --git a/Models/Exam/Disable/DisableEducation.cs b/Models/Exam/Disable/DisableEducation.cs
new file mode 100644
index 0000000..cb2cbb3
--- /dev/null
+++ b/Models/Exam/Disable/DisableEducation.cs
@@ -0,0 +1,33 @@
+using System.ComponentModel.DataAnnotations;
+
+namespace BMA.EHR.Recurit.Exam.Service.Models.Disables
+{
+ public class DisableEducation : EntityBase
+ {
+ [MaxLength(200)]
+ public string Degree { get; set; }
+
+ [MaxLength(200)]
+ public string Major { get; set; }
+
+ [MaxLength(20)]
+ public string MajorGroupId { get; set; }
+
+ [MaxLength(200)]
+ public string MajorGroupName { get; set; }
+
+ [MaxLength(200)]
+ public string University { get; set; }
+ public double GPA { get; set; } = 0.0;
+
+ [MaxLength(1000)]
+ public string Specialist { get; set; }
+
+ [MaxLength(200)]
+ public string HighDegree { get; set; }
+
+ public DateTime BachelorDate { get; set; }
+
+ public Disable Disable { get; set; }
+ }
+}
diff --git a/Models/Exam/Disable/DisableImportHistory.cs b/Models/Exam/Disable/DisableImportHistory.cs
new file mode 100644
index 0000000..bddb2d4
--- /dev/null
+++ b/Models/Exam/Disable/DisableImportHistory.cs
@@ -0,0 +1,14 @@
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace BMA.EHR.Recurit.Exam.Service.Models.Disables
+{
+ public class DisableImportHistory : EntityBase
+ {
+ [Required, Comment("รายละเอียดการนำเข้า"), Column(Order = 1)]
+ public string Description { get; set; } = string.Empty;
+
+ public PeriodExam PeriodExam { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Models/Exam/Disable/DisableOccupation.cs b/Models/Exam/Disable/DisableOccupation.cs
new file mode 100644
index 0000000..23f59c6
--- /dev/null
+++ b/Models/Exam/Disable/DisableOccupation.cs
@@ -0,0 +1,24 @@
+using System.ComponentModel.DataAnnotations;
+
+namespace BMA.EHR.Recurit.Exam.Service.Models.Disables
+{
+ public class DisableOccupation : EntityBase
+ {
+ [MaxLength(200)]
+ public string Occupation { get; set; }
+
+ [MaxLength(200)]
+ public string WorkAge { get; set; }
+
+ [MaxLength(200)]
+ public string Position { get; set; }
+
+ [MaxLength(200)]
+ public string Workplace { get; set; }
+
+ [MaxLength(200)]
+ public string Telephone { get; set; }
+
+ public Disable Disable { get; set; }
+ }
+}
diff --git a/Models/Exam/Disable/DisablePayment.cs b/Models/Exam/Disable/DisablePayment.cs
new file mode 100644
index 0000000..437e963
--- /dev/null
+++ b/Models/Exam/Disable/DisablePayment.cs
@@ -0,0 +1,56 @@
+using System.ComponentModel.DataAnnotations;
+
+namespace BMA.EHR.Recurit.Exam.Service.Models.Disables
+{
+ public class DisablePayment : EntityBase
+ {
+ [MaxLength(50)]
+ public string PaymentId { get; set; }
+
+ [MaxLength(50)]
+ public string CompanyCode { get; set; }
+
+ [MaxLength(50)]
+ public string TextFile { get; set; }
+
+ [MaxLength(50)]
+ public string BankCode { get; set; }
+
+ [MaxLength(50)]
+ public string AccountNumber { get; set; }
+
+ [MaxLength(50)]
+ public string TransDate { get; set; }
+
+ [MaxLength(50)]
+ public string TransTime { get; set; }
+
+ [MaxLength(200)]
+ public string CustomerName { get; set; }
+
+ [MaxLength(50)]
+ public string RefNo1 { get; set; }
+
+ [MaxLength(50)]
+ public string TermBranch { get; set; }
+
+ [MaxLength(50)]
+ public string TellerId { get; set; }
+
+ [MaxLength(50)]
+ public string CreditDebit { get; set; }
+
+ [MaxLength(50)]
+ public string PaymentType { get; set; }
+
+ [MaxLength(50)]
+ public string ChequeNo { get; set; }
+
+ public decimal Amount { get; set; }
+
+ [MaxLength(50)]
+ public string ChqueBankCode { get; set; }
+
+ public Disable Disable { get; set; }
+ }
+}
diff --git a/Models/Exam/Disable/DisableScore.cs b/Models/Exam/Disable/DisableScore.cs
new file mode 100644
index 0000000..1e081fc
--- /dev/null
+++ b/Models/Exam/Disable/DisableScore.cs
@@ -0,0 +1,54 @@
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations;
+
+namespace BMA.EHR.Recurit.Exam.Service.Models.Disables
+{
+ public class DisableScore : EntityBase
+ {
+ [Required, MaxLength(50)]
+ public string ExamId { get; set; }
+
+ public int SumA { get; set; }
+
+ public int FullA { get; set; }
+
+ public double PercentageA { get; set; }
+
+ [MaxLength(50)]
+ public string AStatus { get; set; }
+
+ public int SumB { get; set; }
+
+ public int FullB { get; set; }
+
+ public double PercentageB { get; set; }
+
+ [MaxLength(50)]
+ public string BStatus { get; set; }
+
+ public int SumAB { get; set; }
+
+ [Required, MaxLength(50)]
+ public string ABStatus { get; set; }
+
+ public int SumC { get; set; }
+
+ public int FullC { get; set; }
+
+ public double PercentageC { get; set; }
+
+ [MaxLength(50)]
+ public string CStatus { get; set; }
+
+ [Required, MaxLength(50)]
+ public string ExamStatus { get; set; }
+
+ [MaxLength(200)]
+ public string Major { get; set; }
+
+ [MaxLength(200), Comment("ลำดับที่สอบได้")]
+ public string Number { get; set; } = string.Empty;
+
+ public ScoreImport ScoreImport { get; set; }
+ }
+}
diff --git a/Models/Exam/Disable/ScoreImport.cs b/Models/Exam/Disable/ScoreImport.cs
new file mode 100644
index 0000000..90c32ee
--- /dev/null
+++ b/Models/Exam/Disable/ScoreImport.cs
@@ -0,0 +1,19 @@
+using BMA.EHR.Recruit.Service.Models.Documents;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace BMA.EHR.Recurit.Exam.Service.Models.Disables
+{
+ public class ScoreImport : EntityBase
+ {
+ public int? Year { get; set; }
+
+ public Document ImportFile { get; set; } = new Document();
+
+ public virtual List Scores { get; set; } = new List();
+
+ [ForeignKey("FK_Score_Import_ID")]
+ public Guid PeriodExamId { get; set; }
+
+ public PeriodExam PeriodExam { get; set; }
+ }
+}
diff --git a/Models/Exam/District.cs b/Models/Exam/District.cs
new file mode 100644
index 0000000..0d6c13d
--- /dev/null
+++ b/Models/Exam/District.cs
@@ -0,0 +1,19 @@
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.ComponentModel.DataAnnotations;
+
+namespace BMA.EHR.Recurit.Exam.Service.Models
+{
+ public class District : EntityBase
+ {
+ [Required, MaxLength(150), Column(Order = 1), Comment("เขต/อำเภอ")]
+ public string Name { get; set; } = string.Empty;
+
+ [Column(Order = 2), Comment("สถานะการใช้งาน")]
+ public bool IsActive { get; set; } = true;
+
+ public virtual List SubDistricts { get; set; } = new();
+
+ public virtual Province? Province { get; set; }
+ }
+}
diff --git a/Models/Exam/Education.cs b/Models/Exam/Education.cs
new file mode 100644
index 0000000..2954925
--- /dev/null
+++ b/Models/Exam/Education.cs
@@ -0,0 +1,33 @@
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.ComponentModel.DataAnnotations;
+
+namespace BMA.EHR.Recurit.Exam.Service.Models
+{
+ public class Education : EntityBase
+ {
+ [Required, Column(Order = 7), Comment("Id ผู้สมัคร")]
+ public virtual Candidate? Candidate { get; set; }
+
+ [Comment("Idวุฒิที่ได้รับ")]
+ public Guid? EducationLevelId { get; set; }
+
+ [Comment("วุฒิที่ได้รับ")]
+ public string? EducationLevelName { get; set; }
+
+ [Required, Column(Order = 4), Comment("สาขาวิชา/วิชาเอก")]
+ public string Major { get; set; } = string.Empty;
+
+ [Required, MaxLength(10), Column(Order = 6), Comment("คะแนนเฉลี่ยตลอดหลักสูตร")]
+ public float Scores { get; set; }
+
+ [Required, Column(Order = 3), Comment("ชื่อสถานศึกษา")]
+ public string Name { get; set; } = string.Empty;
+
+ [Required, Column(Order = 1), Comment("ระยะเวลาเริ่ม")]
+ public DateTime DurationStart { get; set; } = DateTime.Now.Date;
+
+ [Required, Column(Order = 2), Comment("ระยะเวลาสิ้นสุด")]
+ public DateTime DurationEnd { get; set; } = DateTime.Now.Date;
+ }
+}
diff --git a/Models/Exam/EducationLevel.cs b/Models/Exam/EducationLevel.cs
new file mode 100644
index 0000000..314bd8c
--- /dev/null
+++ b/Models/Exam/EducationLevel.cs
@@ -0,0 +1,15 @@
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.ComponentModel.DataAnnotations;
+
+namespace BMA.EHR.Recurit.Exam.Service.Models
+{
+ public class EducationLevel : EntityBase
+ {
+ [Required, MaxLength(100), Column(Order = 1), Comment("ระดับการศึกษา")]
+ public string Name { get; set; } = string.Empty;
+
+ [Column(Order = 2), Comment("สถานะการใช้งาน")]
+ public bool IsActive { get; set; } = true;
+ }
+}
diff --git a/Models/Exam/EntityBase.cs b/Models/Exam/EntityBase.cs
new file mode 100644
index 0000000..e83053c
--- /dev/null
+++ b/Models/Exam/EntityBase.cs
@@ -0,0 +1,32 @@
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.Text.Json.Serialization;
+
+namespace BMA.EHR.Recurit.Exam.Service.Models
+{
+ public class EntityBase
+ {
+ [Key, Column(Order = 0), Comment("PrimaryKey")]
+ [JsonPropertyName("id")]
+ public Guid Id { get; set; }
+
+ [Required, Column(Order = 100), Comment("สร้างข้อมูลเมื่อ")]
+ public DateTime CreatedAt { get; set; } = DateTime.Now;
+
+ [Column(Order = 101), Comment("User Id ที่สร้างข้อมูล"), MaxLength(40)]
+ public string CreatedUserId { get; set; } = string.Empty;
+
+ [Column(Order = 102), Comment("แก้ไขข้อมูลล่าสุดเมื่อ")]
+ public DateTime? LastUpdatedAt { get; set; }
+
+ [Column(Order = 103), Comment("User Id ที่แก้ไขข้อมูลล่าสุด"), MaxLength(40)]
+ public string LastUpdateUserId { get; set; } = string.Empty;
+
+ [Column(Order = 104), Comment("ชื่อ User ที่สร้างข้อมูล"), MaxLength(200)]
+ public string CreatedFullName { get; set; } = string.Empty;
+
+ [Column(Order = 105), Comment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), MaxLength(200)]
+ public string LastUpdateFullName { get; set; } = string.Empty;
+ }
+}
diff --git a/Models/Exam/OrganizationOrganization.cs b/Models/Exam/OrganizationOrganization.cs
new file mode 100644
index 0000000..06c6532
--- /dev/null
+++ b/Models/Exam/OrganizationOrganization.cs
@@ -0,0 +1,15 @@
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.ComponentModel.DataAnnotations;
+
+namespace BMA.EHR.Recurit.Exam.Service.Models
+{
+ public class OrganizationOrganization : EntityBase
+ {
+ [Required, MaxLength(100), Column(Order = 1), Comment("ข้อมูลโครงสร้างหน่วยงานชื่อ หน่วยงาน")]
+ public string Name { get; set; } = string.Empty;
+
+ [Column(Order = 2), Comment("สถานะการใช้งาน")]
+ public bool IsActive { get; set; } = true;
+ }
+}
diff --git a/Models/Exam/OrganizationShortName.cs b/Models/Exam/OrganizationShortName.cs
new file mode 100644
index 0000000..8dfcac3
--- /dev/null
+++ b/Models/Exam/OrganizationShortName.cs
@@ -0,0 +1,19 @@
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.ComponentModel.DataAnnotations;
+
+namespace BMA.EHR.Recurit.Exam.Service.Models
+{
+ public class OrganizationShortName : EntityBase
+ {
+ [Required, MaxLength(100), Column(Order = 1), Comment("ข้อมูลโครงสร้างหน่วยงานชื่อ รหัสหน่วยงาน")]
+ public string AgencyCode { get; set; } = string.Empty;
+ [Required, MaxLength(100), Column(Order = 2), Comment("ข้อมูลโครงสร้างหน่วยงานชื่อ รหัสส่วนราชการ")]
+ public string GovernmentCode { get; set; } = string.Empty;
+ [Required, MaxLength(100), Column(Order = 3), Comment("ข้อมูลโครงสร้างหน่วยงานชื่อ ตัวย่อหน่วยงาน")]
+ public string Name { get; set; } = string.Empty;
+
+ [Column(Order = 4), Comment("สถานะการใช้งาน")]
+ public bool IsActive { get; set; } = true;
+ }
+}
diff --git a/Models/Exam/PeriodExam.cs b/Models/Exam/PeriodExam.cs
new file mode 100644
index 0000000..6565920
--- /dev/null
+++ b/Models/Exam/PeriodExam.cs
@@ -0,0 +1,105 @@
+using BMA.EHR.Recruit.Service.Models.Documents;
+using BMA.EHR.Recurit.Exam.Service.Models.Disables;
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace BMA.EHR.Recurit.Exam.Service.Models
+{
+ public class PeriodExam : EntityBase
+ {
+ [Required, MaxLength(150), Column(Order = 8), Comment("ชื่อการสอบ")]
+ public string Name { get; set; } = string.Empty;
+
+ [Required, Comment("ตรวจสอบเอกสารหลังประกาศผลสอบ")]
+ public bool CheckDocument { get; set; } = false;
+
+ [Required, Comment("คนพิการ")]
+ public bool CheckDisability { get; set; } = false;
+
+ [Column(Order = 9), Comment("รอบการสอบ")]
+ public int? Round { get; set; }
+
+ [Comment("ปีงบประมาณ")]
+ public int? Year { get; set; }
+
+ [Comment("ค่าธรรมเนียม")]
+ public float? Fee { get; set; } = 0;
+
+ [Required, Column(Order = 1), Comment("วันเริ่มสมัครสอบ")]
+ public DateTime RegisterStartDate { get; set; } = DateTime.Now.Date;
+
+ [Required, Column(Order = 2), Comment("วันสิ้นสุดสมัครสอบ")]
+ public DateTime RegisterEndDate { get; set; } = DateTime.Now.Date;
+
+ [Required, Column(Order = 3), Comment("วันเริ่มชำระเงิน")]
+ public DateTime PaymentStartDate { get; set; } = DateTime.Now.Date;
+
+ [Required, Column(Order = 4), Comment("วันสิ้นสุดชำระเงิน")]
+ public DateTime PaymentEndDate { get; set; } = DateTime.Now.Date;
+
+ [Required, Column(Order = 5), Comment("วันประกาศผลสอบ")]
+ public DateTime AnnouncementDate { get; set; } = DateTime.Now.Date;
+
+ [Required, Column(Order = 6), Comment("วันเริ่มประกาศ")]
+ public DateTime AnnouncementStartDate { get; set; } = DateTime.Now.Date;
+
+ [Required, Column(Order = 7), Comment("วันสิ้นสุดประกาศ")]
+ public DateTime AnnouncementEndDate { get; set; } = DateTime.Now.Date;
+
+ [Required, Comment("วันที่สอบ")]
+ public DateTime ExamDate { get; set; } = DateTime.Now.Date;
+
+ [Comment("Id รหัสส่วนราชการ")]
+ public Guid? OrganizationCodeId { get; set; }
+
+ [Comment("ชื่อรหัสส่วนราชการ")]
+ public string? OrganizationCodeName { get; set; }
+
+ [Comment("Id หน่วยงาน")]
+ public Guid? OrganizationId { get; set; }
+
+ [Comment("ชื่อหน่วยงาน")]
+ public string? OrganizationName { get; set; }
+
+ [Comment("ชำระเงินผ่านกรุงไทย")]
+ public string? PaymentKrungThai { get; set; }
+
+ [Comment("รายละเอียดสมัครสอบ")]
+ public string? Detail { get; set; }
+
+ [Comment("หมายเหตุ")]
+ public string? Note { get; set; }
+
+ [Comment("สถานะการใช้งาน")]
+ public bool IsActive { get; set; } = true;
+
+ [Comment("เช็คอัพคะแนน")]
+ public bool SetSeat { get; set; } = false;
+
+ [Comment("ประกาศนี้มีสมัครสอบคัดเลือก")]
+ public bool AnnouncementExam { get; set; } = false;
+
+ [Comment("สำนัก")]
+ public string? Category { get; set; }
+
+ [Comment("รายชื่อคนสม้ครในรอบ")]
+ public List Candidate { get; set; } = new List();
+
+ [Comment("ตำแหน่งสมัคร")]
+ public List PositionExam { get; set; } = new List();
+
+ [Comment("ช่องทางชำระเงิน")]
+ public List BankExam { get; set; } = new List();
+
+ [Comment("เอกสารอื่นๆ")]
+ public virtual List PeriodExamDocuments { get; set; } = new();
+
+ [Comment("รูป")]
+ public virtual List PeriodExamImages { get; set; } = new();
+ public Document? ImportFile { get; set; } = new Document();
+ public List Disables { get; set; } = new List();
+ public ScoreImport? ScoreImport { get; set; }
+ public List ImportHostories { get; set; } = new List();
+ }
+}
diff --git a/Models/Exam/PeriodExamDocument.cs b/Models/Exam/PeriodExamDocument.cs
new file mode 100644
index 0000000..c3e817d
--- /dev/null
+++ b/Models/Exam/PeriodExamDocument.cs
@@ -0,0 +1,14 @@
+using BMA.EHR.Recruit.Service.Models.Documents;
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations;
+
+namespace BMA.EHR.Recurit.Exam.Service.Models
+{
+ public class PeriodExamDocument : EntityBase
+ {
+ [Required, Comment("Id รอบสมัครสอบ")]
+ public virtual PeriodExam? PeriodExam { get; set; }
+ [Required, Comment("Id ไฟล์เอกสาร")]
+ public virtual Document? Document { get; set; }
+ }
+}
diff --git a/Models/Exam/PeriodExamImage.cs b/Models/Exam/PeriodExamImage.cs
new file mode 100644
index 0000000..4403ec8
--- /dev/null
+++ b/Models/Exam/PeriodExamImage.cs
@@ -0,0 +1,14 @@
+using BMA.EHR.Recruit.Service.Models.Documents;
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations;
+
+namespace BMA.EHR.Recurit.Exam.Service.Models
+{
+ public class PeriodExamImage : EntityBase
+ {
+ [Required, Comment("Id รอบสมัครสอบ")]
+ public virtual PeriodExam? PeriodExam { get; set; }
+ [Required, Comment("Id ไฟล์รูป")]
+ public virtual Document? Document { get; set; }
+ }
+}
diff --git a/Models/Exam/PositionExam.cs b/Models/Exam/PositionExam.cs
new file mode 100644
index 0000000..486dad8
--- /dev/null
+++ b/Models/Exam/PositionExam.cs
@@ -0,0 +1,23 @@
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations;
+
+namespace BMA.EHR.Recurit.Exam.Service.Models
+{
+ public class PositionExam : EntityBase
+ {
+ [Required, Comment("Id การสอบ")]
+ public virtual PeriodExam? PeriodExam { get; set; }
+
+ [Comment("Id ตำแหน่ง")]
+ public Guid? PositionId { get; set; }
+
+ [Comment("ชื่อตำแหน่ง")]
+ public string? PositionName { get; set; }
+
+ [Comment("Id ประเภทแบบฟอร์ม")]
+ public string? TypeId { get; set; }
+
+ [Comment("ชื่อประเภทแบบฟอร์ม")]
+ public string? TypeName { get; set; }
+ }
+}
diff --git a/Models/Exam/Prefix.cs b/Models/Exam/Prefix.cs
new file mode 100644
index 0000000..91cf8ce
--- /dev/null
+++ b/Models/Exam/Prefix.cs
@@ -0,0 +1,15 @@
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace BMA.EHR.Recurit.Exam.Service.Models
+{
+ public class Prefix : EntityBase
+ {
+ [Required, MaxLength(50), Column(Order = 2), Comment("รายละเอียดคำนำหน้า")]
+ public string Name { get; set; } = string.Empty;
+
+ [Column(Order = 3), Comment("สถานะการใช้งาน")]
+ public bool IsActive { get; set; } = true;
+ }
+}
diff --git a/Models/Exam/Province.cs b/Models/Exam/Province.cs
new file mode 100644
index 0000000..aea5c64
--- /dev/null
+++ b/Models/Exam/Province.cs
@@ -0,0 +1,17 @@
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace BMA.EHR.Recurit.Exam.Service.Models
+{
+ public class Province : EntityBase
+ {
+ [Required, MaxLength(150), Column(Order = 1), Comment("จังหวัด")]
+ public string Name { get; set; } = string.Empty;
+
+ [Column(Order = 2), Comment("สถานะการใช้งาน")]
+ public bool IsActive { get; set; } = true;
+
+ public virtual List Districts { get; set; } = new();
+ }
+}
diff --git a/Models/Exam/Relationship.cs b/Models/Exam/Relationship.cs
new file mode 100644
index 0000000..dae82d2
--- /dev/null
+++ b/Models/Exam/Relationship.cs
@@ -0,0 +1,14 @@
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.ComponentModel.DataAnnotations;
+
+namespace BMA.EHR.Recurit.Exam.Service.Models;
+
+public class Relationship : EntityBase
+{
+ [Required, MaxLength(50), Column(Order = 1), Comment("ชื่อความสัมพันธ์")]
+ public string Name { get; set; } = string.Empty;
+
+ [Column(Order = 2), Comment("สถานะการใช้งาน")]
+ public bool IsActive { get; set; } = true;
+}
\ No newline at end of file
diff --git a/Models/Exam/Religion.cs b/Models/Exam/Religion.cs
new file mode 100644
index 0000000..ae493ec
--- /dev/null
+++ b/Models/Exam/Religion.cs
@@ -0,0 +1,15 @@
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.ComponentModel.DataAnnotations;
+
+namespace BMA.EHR.Recurit.Exam.Service.Models
+{
+ public class Religion : EntityBase
+ {
+ [Required, MaxLength(100), Column(Order = 1), Comment("ศาสนา")]
+ public string Name { get; set; } = string.Empty;
+
+ [Column(Order = 2), Comment("สถานะการใช้งาน")]
+ public bool IsActive { get; set; } = true;
+ }
+}
diff --git a/Models/Exam/SubDistrict.cs b/Models/Exam/SubDistrict.cs
new file mode 100644
index 0000000..d01c634
--- /dev/null
+++ b/Models/Exam/SubDistrict.cs
@@ -0,0 +1,20 @@
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.ComponentModel.DataAnnotations;
+
+namespace BMA.EHR.Recurit.Exam.Service.Models
+{
+ public class SubDistrict : EntityBase
+ {
+ [Required, MaxLength(150), Column(Order = 1), Comment("เขต/อำเภอ")]
+ public string Name { get; set; } = string.Empty;
+
+ [Required, MaxLength(10), Column(Order = 2), Comment("รหัสไปรษณีย์")]
+ public string ZipCode { get; set; } = string.Empty;
+
+ [Column(Order = 3), Comment("สถานะการใช้งาน")]
+ public bool IsActive { get; set; } = true;
+
+ public virtual District? District { get; set; }
+ }
+}
diff --git a/Models/HR/Profile.cs b/Models/HR/Profile.cs
new file mode 100644
index 0000000..8447557
--- /dev/null
+++ b/Models/HR/Profile.cs
@@ -0,0 +1,264 @@
+using BMA.EHR.MetaData.Service.Models;
+using BMA.EHR.Recruit.Service.Models.Documents;
+using System.ComponentModel.DataAnnotations;
+
+namespace BMA.EHR.Profile.Service.Models.HR
+{
+ public class Profile : EntityBase
+ {
+ [Key]
+ public Guid Id { get; set; }
+
+ [MaxLength(13)]
+ public string? CitizenId { get; set; }
+
+ [MaxLength(50)]
+ public string? ProfileType { get; set; }
+
+ [MaxLength(20)]
+ public string? EmployeeType { get; set; }
+
+ [MaxLength(20)]
+ public string? EmployeeClass { get; set; }
+
+ public Guid? PrefixId { get; set; }
+
+ [MaxLength(100)]
+ [Required]
+ public string? FirstName { get; set; }
+
+ [MaxLength(100)]
+ [Required]
+ public string? LastName { get; set; }
+
+ [MaxLength(100)]
+ public string AvatarRef { get; set; }
+
+ public Guid? GenderId { get; set; }
+
+ [MaxLength(100)]
+ public string? Nationality { get; set; }
+
+ [MaxLength(100)]
+ public string? Race { get; set; }
+
+ public Guid? ReligionId { get; set; }
+
+ [Required]
+ public DateTime BirthDate { get; set; }
+
+ public Guid? BloodGroupId { get; set; }
+
+ public Guid? RelationshipId { get; set; }
+
+ [MaxLength(50)]
+ public string? TelephoneNumber { get; set; }
+
+ public bool? Couple { get; set; }
+
+ public Guid? CouplePrefixId { get; set; }
+
+ [MaxLength(100)]
+ public string? CoupleFirstName { get; set; }
+
+ [MaxLength(100)]
+ public string? CoupleLastName { get; set; }
+
+ [MaxLength(100)]
+ public string? CoupleCareer { get; set; }
+
+ public Guid? FatherPrefixId { get; set; }
+
+ [MaxLength(100)]
+ public string? FatherFirstName { get; set; }
+
+ [MaxLength(100)]
+ public string? FatherLastName { get; set; }
+
+ [MaxLength(100)]
+ public string? FatherCareer { get; set; }
+
+ public Guid? MotherPrefixId { get; set; }
+
+ [MaxLength(100)]
+ public string? MotherFirstName { get; set; }
+
+ [MaxLength(100)]
+ public string? MotherLastName { get; set; }
+
+ [MaxLength(100)]
+ public string? MotherCareer { get; set; }
+
+ [MaxLength(200)]
+ public string? CurrentAddress { get; set; }
+
+ public Guid? CurrentSubDistrictId { get; set; }
+
+ public Guid? CurrentDistrictId { get; set; }
+
+ public Guid? CurrentProvinceId { get; set; }
+
+ [MaxLength(5)]
+ public string? CurrentZipCode { get; set; }
+
+ public bool? RegistrationSame { get; set; } = false;
+
+ [MaxLength(200)]
+ public string? RegistrationAddress { get; set; }
+
+ public Guid? RegistrationSubDistrictId { get; set; }
+
+ public Guid? RegistrationDistrictId { get; set; }
+
+ public Guid? RegistrationProvinceId { get; set; }
+
+ [MaxLength(5)]
+ public string? RegistrationZipCode { get; set; }
+
+ public DateTime? DateAppoint { get; set; }
+
+ public DateTime? DateStart { get; set; }
+
+ public DateTime? DateRetire { get; set; }
+
+ public string? ReasonSameDate { get; set; }
+ // public Guid? AffiliationId { get; set; }
+ // public Guid? PositionId { get; set; }
+ // public Guid? WorkId { get; set; }
+ // public Guid? TypeId { get; set; }
+ // public Guid? LevelId { get; set; }
+ // public Guid? NumberId { get; set; }
+ // public Guid? BusinessId { get; set; }
+ public Guid? OcId { get; set; }
+ public string? Oc { get; set; }
+ public Guid? OrganizationShortNameId { get; set; }
+ public string? OrganizationShortName { get; set; }
+ public string? GovernmentCode { get; set; }
+ public Guid? OrganizationOrganizationId { get; set; }
+ public string? OrganizationOrganization { get; set; }
+ public Guid? PositionId { get; set; }
+ public string? Position { get; set; }
+ public Guid? PosNoId { get; set; }
+ public string? PosNo { get; set; }
+ public Guid? PositionLineId { get; set; }
+ public string? PositionLine { get; set; }
+ public Guid? PositionPathSideId { get; set; }
+ public string? PositionPathSide { get; set; }
+ public Guid? PositionTypeId { get; set; }
+ public string? PositionType { get; set; }
+ public Guid? PositionLevelId { get; set; }
+ public string? PositionLevel { get; set; }
+ public Guid? PositionExecutiveId { get; set; }
+ public string? PositionExecutive { get; set; }
+ public Guid? PositionExecutiveSideId { get; set; }
+ public string? PositionExecutiveSide { get; set; }
+
+
+ [MaxLength(100)]
+ public string Physical { get; set; }
+
+ [MaxLength(100)]
+ public string Ability { get; set; }
+
+ public bool IsActive { get; set; } = true;
+
+ public bool IsLeave { get; set; } = false;
+
+ public DateTime? LeaveDate { get; set; }
+
+ [MaxLength(1000)]
+ public string? LeaveReason { get; set; }
+
+ public DateTime? CreatedDate { get; set; }
+
+ public DateTime? ModifiedDate { get; set; }
+
+ [MaxLength(250)]
+ public string CreatedUser { get; set; } = string.Empty;
+
+ [MaxLength(5)]
+ public string EntryStatus { get; set; } = "st1"; // สถานะการตรวจสอบ st1 = create; st2 = pending
+
+ public bool IsTransfer { get; set; } = false;
+
+ public DateTime? TransferDate { get; set; }
+
+ public int GovAgeAbsent { get; set; } = 0;
+
+ public int GovAgePlus { get; set; } = 0;
+
+ // public OrganizationEntity? Organization { get; set; }
+
+ // public PositionNumberEntity PositionNumber { get; set; }
+
+ // public Position Position { get; set; }
+
+ // public PositionExecutive PositionExecutive { get; set; }
+
+ public bool IsVerified { get; set; } = false;
+
+ [MaxLength(100)]
+ public string VerifiedUser { get; set; } = string.Empty;
+
+ public DateTime? VerifiedDate { get; set; }
+
+ public Document? Avatar { get; set; }
+
+ public bool IsProbation { get; set; } = true;
+
+ // public PositionType PositionType { get; set; } // ประเภทตำแหน่ง
+
+ // public PositionLevel PositionLevel { get; set; } // ระดับ
+
+ // public OrganizationPositionEntity? OrganizationPosition { get; set; }
+
+ public virtual List Educations { get; set; } = new List();
+
+ public virtual List Honors { get; set; } = new List();
+ public virtual List Assessments { get; set; } = new List();
+
+ public virtual List Disciplines { get; set; } = new List();
+
+ public virtual List Certificates { get; set; } = new List();
+
+ public virtual List Trainings { get; set; } = new List();
+
+ public virtual List Insignias { get; set; } = new List();
+
+ public virtual List Salaries { get; set; } = new List();
+
+ public virtual List ProfileHistory { get; set; } = new List();
+
+ public virtual List CoupleHistory { get; set; } = new List();
+
+ public virtual List FatherHistory { get; set; } = new List();
+
+ public virtual List MotherHistory { get; set; } = new List();
+
+ public virtual List FamilyHistory { get; set; } = new List();
+
+ public virtual List GovernmentHistory { get; set; } = new List();
+
+ public virtual List Leaves { get; set; } = new List();
+
+ public virtual List CurrentAddressHistory { get; set; } = new List();
+
+ public virtual List RegistrationAddressHistory { get; set; } = new List();
+
+ public virtual List AddressHistory { get; set; } = new List();
+
+ public virtual List Others { get; set; } = new List();
+
+ public virtual List Abilitys { get; set; } = new List();
+
+ public virtual List Dutys { get; set; } = new List();
+
+ public virtual List Nopaids { get; set; } = new List();
+
+ public virtual List AvatarHistory { get; set; } = new List();
+
+ public virtual List Papers { get; set; } = new List();
+
+ public virtual List Childrens { get; set; } = new List();
+ }
+}
diff --git a/Models/HR/ProfileAbility.cs b/Models/HR/ProfileAbility.cs
new file mode 100644
index 0000000..30fae62
--- /dev/null
+++ b/Models/HR/ProfileAbility.cs
@@ -0,0 +1,44 @@
+using BMA.EHR.Report.Service.Models;
+using System;
+using System.ComponentModel.DataAnnotations;
+
+namespace BMA.EHR.Profile.Service.Models.HR
+{
+ public class ProfileAbility : EntityBase
+ {
+ ///
+ /// ด้าน (ใช้เฉพาะ ความสามารถพิเศษ)
+ ///
+ public string? Field { get; set; }
+
+ ///
+ /// รายละเอียด
+ ///
+ public string? Detail { get; set; }
+
+ ///
+ /// หมายเหตุ
+ ///
+ public string? Remark { get; set; }
+
+ ///
+ /// วันที่เริ่มต้น
+ ///
+ public DateTime? DateStart { get; set; }
+
+ ///
+ /// วันที่สิ้นสุด
+ ///
+ public DateTime? DateEnd { get; set; }
+
+ ///
+ /// เอกสารอ้างอิง
+ ///
+ public string? Reference { get; set; }
+ // public string? Side { get; set; }
+ // public string? Detail { get; set; }
+ // public string? Note { get; set; }
+ public virtual List ProfileAbilityHistorys { get; set; } = new List();
+ public virtual Profile? Profile { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Models/HR/ProfileAbilityHistory.cs b/Models/HR/ProfileAbilityHistory.cs
new file mode 100644
index 0000000..7897dea
--- /dev/null
+++ b/Models/HR/ProfileAbilityHistory.cs
@@ -0,0 +1,43 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using BMA.EHR.Report.Service.Models;
+
+namespace BMA.EHR.Profile.Service.Models.HR
+{
+ public class ProfileAbilityHistory : EntityBase
+ {
+ ///
+ /// ด้าน (ใช้เฉพาะ ความสามารถพิเศษ)
+ ///
+ public string? Field { get; set; }
+
+ ///
+ /// รายละเอียด
+ ///
+ public string? Detail { get; set; }
+
+ ///
+ /// หมายเหตุ
+ ///
+ public string? Remark { get; set; }
+
+ ///
+ /// วันที่เริ่มต้น
+ ///
+ public DateTime? DateStart { get; set; }
+
+ ///
+ /// วันที่สิ้นสุด
+ ///
+ public DateTime? DateEnd { get; set; }
+
+ ///
+ /// เอกสารอ้างอิง
+ ///
+ public string? Reference { get; set; }
+ // public string? Side { get; set; }
+ // public string? Detail { get; set; }
+ // public string? Note { get; set; }
+ public virtual ProfileAbility? ProfileAbility { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Models/HR/ProfileAddressHistory.cs b/Models/HR/ProfileAddressHistory.cs
new file mode 100644
index 0000000..a833e76
--- /dev/null
+++ b/Models/HR/ProfileAddressHistory.cs
@@ -0,0 +1,33 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using BMA.EHR.Report.Service.Models;
+
+namespace BMA.EHR.Profile.Service.Models.HR
+{
+ public class ProfileAddressHistory : EntityBase
+ {
+ public bool? RegistrationSame { get; set; }
+ [MaxLength(200)]
+ public string? RegistrationAddress { get; set; }
+ public Guid? RegistrationSubDistrictId { get; set; }
+ public string? RegistrationSubDistrict { get; set; }
+ public Guid? RegistrationDistrictId { get; set; }
+ public string? RegistrationDistrict { get; set; }
+ public Guid? RegistrationProvinceId { get; set; }
+ public string? RegistrationProvince { get; set; }
+ [MaxLength(5)]
+ public string? RegistrationZipCode { get; set; }
+ [MaxLength(200)]
+ public string? CurrentAddress { get; set; }
+ public Guid? CurrentSubDistrictId { get; set; }
+ public string? CurrentSubDistrict { get; set; }
+ public Guid? CurrentDistrictId { get; set; }
+ public string? CurrentDistrict { get; set; }
+ public Guid? CurrentProvinceId { get; set; }
+ public string? CurrentProvince { get; set; }
+ [MaxLength(5)]
+ public string? CurrentZipCode { get; set; }
+ public virtual Profile? Profile { get; set; }
+ }
+}
+
diff --git a/Models/HR/ProfileAssessment.cs b/Models/HR/ProfileAssessment.cs
new file mode 100644
index 0000000..0674b80
--- /dev/null
+++ b/Models/HR/ProfileAssessment.cs
@@ -0,0 +1,15 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using BMA.EHR.Report.Service.Models;
+
+namespace BMA.EHR.Profile.Service.Models.HR
+{
+ public class ProfileAssessment : EntityBase
+ {
+ public string? Name { get; set; }
+ public DateTime? Date { get; set; }
+ public double? Point { get; set; }
+ public virtual List ProfileAssessmentHistorys { get; set; } = new List();
+ public virtual Profile? Profile { get; set; }
+ }
+}
diff --git a/Models/HR/ProfileAssessmentHistory.cs b/Models/HR/ProfileAssessmentHistory.cs
new file mode 100644
index 0000000..177f9ca
--- /dev/null
+++ b/Models/HR/ProfileAssessmentHistory.cs
@@ -0,0 +1,14 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using BMA.EHR.Report.Service.Models;
+
+namespace BMA.EHR.Profile.Service.Models.HR
+{
+ public class ProfileAssessmentHistory : EntityBase
+ {
+ public string? Name { get; set; }
+ public DateTime? Date { get; set; }
+ public double? Point { get; set; }
+ public virtual ProfileAssessment? ProfileAssessment { get; set; }
+ }
+}
diff --git a/Models/HR/ProfileAvatarHistory.cs b/Models/HR/ProfileAvatarHistory.cs
new file mode 100644
index 0000000..67f665c
--- /dev/null
+++ b/Models/HR/ProfileAvatarHistory.cs
@@ -0,0 +1,18 @@
+using BMA.EHR.Recruit.Service.Models.Documents;
+using BMA.EHR.Report.Service.Models;
+using System.ComponentModel.DataAnnotations;
+
+namespace BMA.EHR.Profile.Service.Models.HR
+{
+ public class ProfileAvatarHistory : EntityBase
+ {
+ // [Key]
+ // public int Id { get; set; }
+
+ // public DateTime CreatedDate { get; set; } = DateTime.Now;
+
+ public Document AvatarFile { get; set; }
+
+ public Profile Profile { get; set; }
+ }
+}
diff --git a/Models/HR/ProfileCertificate.cs b/Models/HR/ProfileCertificate.cs
new file mode 100644
index 0000000..70ae3b4
--- /dev/null
+++ b/Models/HR/ProfileCertificate.cs
@@ -0,0 +1,28 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using BMA.EHR.Report.Service.Models;
+
+namespace BMA.EHR.Profile.Service.Models.HR
+{
+ public class ProfileCertificate : EntityBase
+ {
+ // [Key]
+ // public int Id { get; set; }
+ // [Required]
+ // public int Order { get; set; }
+ [MaxLength(20)]
+ public string? CertificateNo { get; set; }
+ [MaxLength(200)]
+ public string? Issuer { get; set; }
+ public DateTime? IssueDate { get; set; }
+ public DateTime? ExpireDate { get; set; }
+ [MaxLength(100)]
+ public string? CertificateType { get; set; }
+ // public string? Name { get; set; }
+ // public string? CertiNumber { get; set; }
+ // public DateTime? Start { get; set; }
+ // public DateTime? End { get; set; }
+ public virtual List ProfileCertificateHistorys { get; set; } = new List();
+ public virtual Profile? Profile { get; set; }
+ }
+}
diff --git a/Models/HR/ProfileCertificateHistory.cs b/Models/HR/ProfileCertificateHistory.cs
new file mode 100644
index 0000000..c7bccff
--- /dev/null
+++ b/Models/HR/ProfileCertificateHistory.cs
@@ -0,0 +1,23 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using BMA.EHR.Report.Service.Models;
+
+namespace BMA.EHR.Profile.Service.Models.HR
+{
+ public class ProfileCertificateHistory : EntityBase
+ {
+ [MaxLength(20)]
+ public string? CertificateNo { get; set; }
+ [MaxLength(200)]
+ public string? Issuer { get; set; }
+ public DateTime? IssueDate { get; set; }
+ public DateTime? ExpireDate { get; set; }
+ [MaxLength(100)]
+ public string? CertificateType { get; set; }
+ // public string? Name { get; set; }
+ // public string? CertiNumber { get; set; }
+ // public DateTime? Start { get; set; }
+ // public DateTime? End { get; set; }
+ public virtual ProfileCertificate? ProfileCertificate { get; set; }
+ }
+}
diff --git a/Models/HR/ProfileChildren.cs b/Models/HR/ProfileChildren.cs
new file mode 100644
index 0000000..427d033
--- /dev/null
+++ b/Models/HR/ProfileChildren.cs
@@ -0,0 +1,16 @@
+using System.ComponentModel.DataAnnotations;
+using BMA.EHR.Report.Service.Models;
+
+namespace BMA.EHR.Profile.Service.Models.HR
+{
+ public class ProfileChildren : EntityBase
+ {
+ public Guid? ChildrenPrefixId { get; set; }
+ public string? ChildrenPrefix { get; set; }
+ public string? ChildrenFirstName { get; set; }
+ public string? ChildrenLastName { get; set; }
+ public string? ChildrenCareer { get; set; }
+ public virtual List ProfileChildrenHistorys { get; set; } = new List();
+ public Profile? Profile { get; set; }
+ }
+}
diff --git a/Models/HR/ProfileChildrenHistory.cs b/Models/HR/ProfileChildrenHistory.cs
new file mode 100644
index 0000000..618bdcf
--- /dev/null
+++ b/Models/HR/ProfileChildrenHistory.cs
@@ -0,0 +1,14 @@
+using System.ComponentModel.DataAnnotations;
+using BMA.EHR.Report.Service.Models;
+
+namespace BMA.EHR.Profile.Service.Models.HR
+{
+ public class ProfileChildrenHistory : EntityBase
+ {
+ public Guid? ChildrenPrefixId { get; set; }
+ public string? ChildrenPrefix { get; set; }
+ public string? ChildrenFirstName { get; set; }
+ public string? ChildrenLastName { get; set; }
+ public string? ChildrenCareer { get; set; }
+ }
+}
diff --git a/Models/HR/ProfileCoupleHistory.cs b/Models/HR/ProfileCoupleHistory.cs
new file mode 100644
index 0000000..01b8a8a
--- /dev/null
+++ b/Models/HR/ProfileCoupleHistory.cs
@@ -0,0 +1,30 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+
+namespace BMA.EHR.Profile.Service.Models.HR
+{
+ public class ProfileCoupleHistory
+ {
+ [Key]
+ public int Id { get; set; }
+
+ [Required]
+ [MaxLength(50)]
+ public string Prefix { get; set; }
+
+ [Required]
+ [MaxLength(100)]
+ public string FirstName { get; set; }
+
+ [Required]
+ [MaxLength(100)]
+ public string LastName { get; set; }
+
+ [MaxLength(100)]
+ public string Career { get; set; }
+
+ public DateTime CreatedDate { get; set; } = DateTime.Now;
+
+ public Profile Profile { get; set; }
+ }
+}
diff --git a/Models/HR/ProfileCurrentAddressHistory.cs b/Models/HR/ProfileCurrentAddressHistory.cs
new file mode 100644
index 0000000..0effa46
--- /dev/null
+++ b/Models/HR/ProfileCurrentAddressHistory.cs
@@ -0,0 +1,33 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+
+namespace BMA.EHR.Profile.Service.Models.HR
+{
+ public class ProfileCurrentAddressHistory
+ {
+ [Key]
+ public int Id { get; set; }
+
+ [MaxLength(200)]
+ [Required]
+ public string Address { get; set; }
+
+ [Required]
+ public Guid SubDistrictId { get; set; }
+
+ [Required]
+ public Guid DistrictId { get; set; }
+
+ [Required]
+ public Guid ProvinceId { get; set; }
+
+ [MaxLength(5)]
+ [Required]
+ public string ZipCode { get; set; }
+
+ public DateTime CreatedDate { get; set; } = DateTime.Now;
+
+ public Profile Profile { get; set; }
+ }
+}
+
diff --git a/Models/HR/ProfileDiscipline.cs b/Models/HR/ProfileDiscipline.cs
new file mode 100644
index 0000000..ac1baff
--- /dev/null
+++ b/Models/HR/ProfileDiscipline.cs
@@ -0,0 +1,28 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using BMA.EHR.Report.Service.Models;
+
+namespace BMA.EHR.Profile.Service.Models.HR
+{
+ public class ProfileDiscipline : EntityBase
+ {
+ // [Key]
+ // public int Id { get; set; }
+ // [Required]
+ // public int Order { get; set; }
+ public string? Level { get; set; }
+ [Column(TypeName = "text")]
+ public string? Detail { get; set; }
+ public string? RefCommandNo { get; set; }
+ public DateTime? RefCommandDate { get; set; }
+ public DateTime? Date { get; set; }
+ // public DateTime? Date { get; set; }
+ // public string? Status { get; set; }
+ // public string? Level { get; set; }
+ // public string? RefNo { get; set; }
+ // public DateTime? RefDate { get; set; }
+ public virtual List ProfileDisciplineHistorys { get; set; } = new List();
+ public virtual Profile? Profile { get; set; }
+ }
+}
diff --git a/Models/HR/ProfileDisciplineHistory.cs b/Models/HR/ProfileDisciplineHistory.cs
new file mode 100644
index 0000000..cd4f965
--- /dev/null
+++ b/Models/HR/ProfileDisciplineHistory.cs
@@ -0,0 +1,23 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using BMA.EHR.Report.Service.Models;
+
+namespace BMA.EHR.Profile.Service.Models.HR
+{
+ public class ProfileDisciplineHistory : EntityBase
+ {
+ public string? Level { get; set; }
+ [Column(TypeName = "text")]
+ public string? Detail { get; set; }
+ public string? RefCommandNo { get; set; }
+ public DateTime? RefCommandDate { get; set; }
+ public DateTime? Date { get; set; }
+ // public DateTime? Date { get; set; }
+ // public string? Status { get; set; }
+ // public string? Level { get; set; }
+ // public string? RefNo { get; set; }
+ // public DateTime? RefDate { get; set; }
+ public virtual ProfileDiscipline? ProfileDiscipline { get; set; }
+ }
+}
diff --git a/Models/HR/ProfileDuty.cs b/Models/HR/ProfileDuty.cs
new file mode 100644
index 0000000..f8f518d
--- /dev/null
+++ b/Models/HR/ProfileDuty.cs
@@ -0,0 +1,16 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using BMA.EHR.Report.Service.Models;
+
+namespace BMA.EHR.Profile.Service.Models.HR
+{
+ public class ProfileDuty : EntityBase
+ {
+ public DateTime? DateStart { get; set; }
+ public DateTime? DateEnd { get; set; }
+ public string? Detail { get; set; }
+ public string? Reference { get; set; }
+ public virtual List ProfileDutyHistorys { get; set; } = new List();
+ public virtual Profile? Profile { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Models/HR/ProfileDutyHistory.cs b/Models/HR/ProfileDutyHistory.cs
new file mode 100644
index 0000000..6020a87
--- /dev/null
+++ b/Models/HR/ProfileDutyHistory.cs
@@ -0,0 +1,15 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using BMA.EHR.Report.Service.Models;
+
+namespace BMA.EHR.Profile.Service.Models.HR
+{
+ public class ProfileDutyHistory : EntityBase
+ {
+ public DateTime? DateStart { get; set; }
+ public DateTime? DateEnd { get; set; }
+ public string? Detail { get; set; }
+ public string? Reference { get; set; }
+ public virtual ProfileDuty? ProfileDuty { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Models/HR/ProfileEducation.cs b/Models/HR/ProfileEducation.cs
new file mode 100644
index 0000000..cc93425
--- /dev/null
+++ b/Models/HR/ProfileEducation.cs
@@ -0,0 +1,44 @@
+using System.ComponentModel.DataAnnotations;
+using BMA.EHR.MetaData.Service.Models;
+
+namespace BMA.EHR.Profile.Service.Models.HR
+{
+ public class ProfileEducation : EntityBase
+ {
+ // [Key]
+ // public int Id { get; set; }
+ // [Required]
+ // public int Order { get; set; }
+ [MaxLength(1000)]
+ public string? Institute { get; set; }
+ [MaxLength(200)]
+ public string? Degree { get; set; }
+ [MaxLength(200)]
+ public string? Field { get; set; }
+ [MaxLength(20)]
+ public string? Gpa { get; set; }
+ [MaxLength(1000)]
+ public string? Country { get; set; }
+ [MaxLength(1000)]
+ public string? Duration { get; set; }
+ [MaxLength(1000)]
+ public string? Other { get; set; }
+ [MaxLength(1000)]
+ public string? FundName { get; set; }
+ public int DurationYear { get; set; }
+ public DateTime? FinishDate { get; set; }
+ public DateTime? StartDate { get; set; }
+ public DateTime? EndDate { get; set; }
+ // public EducationLevel? EducationLevel { get; set; }
+ public string? EducationLevel { get; set; }
+ public Guid? EducationLevelId { get; set; }
+ // public string? Name { get; set; }
+ // public int? Start { get; set; }
+ // public int? End { get; set; }
+ // public string? Education { get; set; }
+ // public string? Major { get; set; }
+ public virtual List ProfileEducationHistorys { get; set; } = new List();
+ public virtual Profile? Profile { get; set; }
+
+ }
+}
diff --git a/Models/HR/ProfileEducationHistory.cs b/Models/HR/ProfileEducationHistory.cs
new file mode 100644
index 0000000..cf6101b
--- /dev/null
+++ b/Models/HR/ProfileEducationHistory.cs
@@ -0,0 +1,32 @@
+using System.ComponentModel.DataAnnotations;
+using BMA.EHR.MetaData.Service.Models;
+
+namespace BMA.EHR.Profile.Service.Models.HR
+{
+ public class ProfileEducationHistory : EntityBase
+ {
+ [MaxLength(1000)]
+ public string? Institute { get; set; }//
+ [MaxLength(200)]
+ public string? Degree { get; set; }//
+ [MaxLength(200)]
+ public string? Field { get; set; }//
+ [MaxLength(20)]
+ public string? Gpa { get; set; }//
+ [MaxLength(1000)]
+ public string? Country { get; set; }//
+ [MaxLength(1000)]
+ public string? Duration { get; set; }//
+ [MaxLength(1000)]
+ public string? Other { get; set; }//
+ [MaxLength(1000)]
+ public string? FundName { get; set; }//
+ public int DurationYear { get; set; }//
+ public DateTime? FinishDate { get; set; }//
+ public DateTime? StartDate { get; set; }//
+ public DateTime? EndDate { get; set; }//
+ public string? EducationLevel { get; set; }
+ public Guid? EducationLevelId { get; set; }
+ public virtual ProfileEducation? ProfileEducation { get; set; }
+ }
+}
diff --git a/Models/HR/ProfileFamilyHistory.cs b/Models/HR/ProfileFamilyHistory.cs
new file mode 100644
index 0000000..43e8863
--- /dev/null
+++ b/Models/HR/ProfileFamilyHistory.cs
@@ -0,0 +1,32 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using BMA.EHR.Report.Service.Models;
+
+namespace BMA.EHR.Profile.Service.Models.HR
+{
+ public class ProfileFamilyHistory : EntityBase
+ {
+ public bool? Couple { get; set; }
+
+ public Guid? CouplePrefixId { get; set; }
+ public string? CouplePrefix { get; set; }
+ public string? CoupleFirstName { get; set; }
+ public string? CoupleLastName { get; set; }
+ public string? CoupleCareer { get; set; }
+
+ public Guid? FatherPrefixId { get; set; }
+ public string? FatherPrefix { get; set; }
+ public string? FatherFirstName { get; set; }
+ public string? FatherLastName { get; set; }
+ public string? FatherCareer { get; set; }
+
+ public Guid? MotherPrefixId { get; set; }
+ public string? MotherPrefix { get; set; }
+ public string? MotherFirstName { get; set; }
+ public string? MotherLastName { get; set; }
+ public string? MotherCareer { get; set; }
+ public virtual Profile? Profile { get; set; }
+
+ public virtual List Childrens { get; set; } = new List();
+ }
+}
diff --git a/Models/HR/ProfileFatherHistory.cs b/Models/HR/ProfileFatherHistory.cs
new file mode 100644
index 0000000..d29ea92
--- /dev/null
+++ b/Models/HR/ProfileFatherHistory.cs
@@ -0,0 +1,30 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+
+namespace BMA.EHR.Profile.Service.Models.HR
+{
+ public class ProfileFatherHistory
+ {
+ [Key]
+ public int Id { get; set; }
+
+ [Required]
+ [MaxLength(50)]
+ public string Prefix { get; set; }
+
+ [Required]
+ [MaxLength(100)]
+ public string FirstName { get; set; }
+
+ [Required]
+ [MaxLength(100)]
+ public string LastName { get; set; }
+
+ [MaxLength(100)]
+ public string Career { get; set; }
+
+ public DateTime CreatedDate { get; set; } = DateTime.Now;
+
+ public Profile Profile { get; set; }
+ }
+}
diff --git a/Models/HR/ProfileGovernmentHistory.cs b/Models/HR/ProfileGovernmentHistory.cs
new file mode 100644
index 0000000..d5e8472
--- /dev/null
+++ b/Models/HR/ProfileGovernmentHistory.cs
@@ -0,0 +1,37 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using BMA.EHR.Report.Service.Models;
+
+namespace BMA.EHR.Profile.Service.Models.HR
+{
+ public class ProfileGovernmentHistory : EntityBase
+ {
+ // public Guid? AffiliationId { get; set; }
+ // public Guid? PositionId { get; set; }
+ // public Guid? WorkId { get; set; }
+ // public Guid? TypeId { get; set; }
+ // public Guid? LevelId { get; set; }
+ // public Guid? NumberId { get; set; }
+ // public Guid? BusinessId { get; set; }
+ public string? ReasonSameDate { get; set; }
+ public Guid? OcId { get; set; }
+ public string? Oc { get; set; }
+ public Guid? PositionId { get; set; }
+ public string? Position { get; set; }
+ public Guid? PosNoId { get; set; }
+ public string? PosNo { get; set; }
+ public string? PositionLine { get; set; }
+ // public string? PositionPathSide { get; set; }
+ public string? PositionType { get; set; }
+ public string? PositionLevel { get; set; }
+ public string? PositionExecutive { get; set; }
+ // public string? PositionExecutiveSide { get; set; }
+ public DateTime? DateAppoint { get; set; }
+ public DateTime? DateStart { get; set; }
+ public string? RetireDate { get; set; }
+ public string? GovAge { get; set; }
+ public int? GovAgeAbsent { get; set; } = 0;
+ public int? GovAgePlus { get; set; } = 0;
+ public virtual Profile? Profile { get; set; }
+ }
+}
diff --git a/Models/HR/ProfileHistory.cs b/Models/HR/ProfileHistory.cs
new file mode 100644
index 0000000..2f2473c
--- /dev/null
+++ b/Models/HR/ProfileHistory.cs
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using BMA.EHR.Report.Service.Models;
+
+namespace BMA.EHR.Profile.Service.Models.HR
+{
+ public class ProfileHistory : EntityBase
+ {
+ [MaxLength(13)]
+ public string? CitizenId { get; set; }
+ public Guid? PrefixId { get; set; }
+ public string? Prefix { get; set; }
+ [MaxLength(100)]
+ [Required]
+ public string? FirstName { get; set; }
+ [MaxLength(100)]
+ [Required]
+ public string? LastName { get; set; }
+ public Guid? GenderId { get; set; }
+ public string? Gender { get; set; }
+ [MaxLength(100)]
+ public string? Nationality { get; set; }
+ [MaxLength(100)]
+ public string? Race { get; set; }
+ public Guid? ReligionId { get; set; }
+ public string? Religion { get; set; }
+ [Required]
+ public DateTime BirthDate { get; set; }
+ public Guid? BloodGroupId { get; set; }
+ public string? BloodGroup { get; set; }
+ public Guid? RelationshipId { get; set; }
+ public string? Relationship { get; set; }
+ [MaxLength(50)]
+ public string? TelephoneNumber { get; set; }
+ [MaxLength(20)]
+ public string? EmployeeType { get; set; }
+ [MaxLength(20)]
+ public string? EmployeeClass { get; set; }
+ public virtual Profile? Profile { get; set; }
+ }
+}
diff --git a/Models/HR/ProfileHonor.cs b/Models/HR/ProfileHonor.cs
new file mode 100644
index 0000000..7bf556a
--- /dev/null
+++ b/Models/HR/ProfileHonor.cs
@@ -0,0 +1,28 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using BMA.EHR.Report.Service.Models;
+
+namespace BMA.EHR.Profile.Service.Models.HR
+{
+ public class ProfileHonor : EntityBase
+ {
+ // [Key]
+ // public int Id { get; set; }
+ // [Required]
+ // public int Order { get; set; }
+ // [MaxLength(20)]
+ // public string? No { get; set; }
+ [MaxLength(200)]
+ public string? Issuer { get; set; }
+ [MaxLength(2000)]
+ public string? Detail { get; set; }
+ public DateTime? IssueDate { get; set; }
+
+ // public DateTime? ReceiveDate { get; set; }
+ // public string? Detail { get; set; }
+ // public Guid? OrganizationOrganizationId { get; set; }
+ // public string? OrganizationOrganization { get; set; }
+ public virtual List ProfileHonorHistorys { get; set; } = new List();
+ public virtual Profile? Profile { get; set; }
+ }
+}
diff --git a/Models/HR/ProfileHonorHistory.cs b/Models/HR/ProfileHonorHistory.cs
new file mode 100644
index 0000000..ab6f92b
--- /dev/null
+++ b/Models/HR/ProfileHonorHistory.cs
@@ -0,0 +1,21 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using BMA.EHR.Report.Service.Models;
+
+namespace BMA.EHR.Profile.Service.Models.HR
+{
+ public class ProfileHonorHistory : EntityBase
+ {
+ [MaxLength(200)]
+ public string? Issuer { get; set; }
+ [MaxLength(2000)]
+ public string? Detail { get; set; }
+ public DateTime? IssueDate { get; set; }
+
+ // public DateTime? ReceiveDate { get; set; }
+ // public string? Detail { get; set; }
+ // public Guid? OrganizationOrganizationId { get; set; }
+ // public string? OrganizationOrganization { get; set; }
+ public virtual ProfileHonor? ProfileHonor { get; set; }
+ }
+}
diff --git a/Models/HR/ProfileInsignia.cs b/Models/HR/ProfileInsignia.cs
new file mode 100644
index 0000000..47aa18a
--- /dev/null
+++ b/Models/HR/ProfileInsignia.cs
@@ -0,0 +1,50 @@
+using BMA.EHR.MetaData.Service.Models;
+using System.ComponentModel.DataAnnotations;
+
+namespace BMA.EHR.Profile.Service.Models.HR
+{
+ public class ProfileInsignia : EntityBase
+ {
+ // [Key]
+ // public int Id { get; set; }
+ // [Required]
+ // public int Order { get; set; }
+ // public Insignia Insignia { get; set; }
+ // public DateTime DateReceive { get; set; }
+ public int Year { get; set; }
+ // [MaxLength(300)]
+ // public string? Level { get; set; }
+ [MaxLength(20)]
+ public string? No { get; set; }
+ [MaxLength(300)]
+ public string? Issue { get; set; }
+ [MaxLength(30)]
+ public string? VolumeNo { get; set; }
+ [MaxLength(30)]
+ public string? Volume { get; set; }
+ [MaxLength(30)]
+ public string? Section { get; set; }
+ [MaxLength(30)]
+ public string? Page { get; set; }
+ // public DateTime? DateStamp { get; set; }
+ public DateTime? DateAnnounce { get; set; }
+ // public DateTime? EndDate { get; set; }
+
+
+ // public int? Year { get; set; }
+ public DateTime? ReceiveDate { get; set; }
+ public string? InsigniaType { get; set; }
+ // public InsigniaType? InsigniaType { get; set; }
+ public string? Insignia { get; set; }
+ public Guid? InsigniaId { get; set; }
+ // public Insignia? Insignia { get; set; }
+ // public string? No { get; set; }
+ // public string? GazetteNo { get; set; }
+ // public string? Volume { get; set; }
+ // public string? Book { get; set; }
+ // public string? Section { get; set; }
+ // public string? Page { get; set; }
+ public virtual List ProfileInsigniaHistorys { get; set; } = new List();
+ public virtual Profile? Profile { get; set; }
+ }
+}
diff --git a/Models/HR/ProfileInsigniaHistory.cs b/Models/HR/ProfileInsigniaHistory.cs
new file mode 100644
index 0000000..6d94f6e
--- /dev/null
+++ b/Models/HR/ProfileInsigniaHistory.cs
@@ -0,0 +1,40 @@
+using BMA.EHR.MetaData.Service.Models;
+using System.ComponentModel.DataAnnotations;
+
+namespace BMA.EHR.Profile.Service.Models.HR
+{
+ public class ProfileInsigniaHistory : EntityBase
+ {
+ public int Year { get; set; }
+ // [MaxLength(300)]
+ // public string? Level { get; set; }
+ [MaxLength(20)]
+ public string? No { get; set; }
+ [MaxLength(300)]
+ public string? Issue { get; set; }
+ [MaxLength(30)]
+ public string? VolumeNo { get; set; }
+ [MaxLength(30)]
+ public string? Volume { get; set; }
+ [MaxLength(30)]
+ public string? Section { get; set; }
+ [MaxLength(30)]
+ public string? Page { get; set; }
+ // public DateTime? DateStamp { get; set; }
+ public DateTime? DateAnnounce { get; set; }
+ // public DateTime? EndDate { get; set; }
+
+ // public int? Year { get; set; }
+ public DateTime? ReceiveDate { get; set; }
+ public string? InsigniaType { get; set; }
+ public string? Insignia { get; set; }
+ public Guid? InsigniaId { get; set; }
+ // public string? No { get; set; }
+ // public string? GazetteNo { get; set; }
+ // public string? Volume { get; set; }
+ // public string? Book { get; set; }
+ // public string? Section { get; set; }
+ // public string? Page { get; set; }
+ public virtual ProfileInsignia? ProfileInsignia { get; set; }
+ }
+}
diff --git a/Models/HR/ProfileLeave.cs b/Models/HR/ProfileLeave.cs
new file mode 100644
index 0000000..64dd91d
--- /dev/null
+++ b/Models/HR/ProfileLeave.cs
@@ -0,0 +1,58 @@
+using System.ComponentModel.DataAnnotations;
+using BMA.EHR.Report.Service.Models;
+
+namespace BMA.EHR.Profile.Service.Models.HR
+{
+ public class ProfileLeave : EntityBase
+ {
+ // [Key]
+ // public int Id { get; set; }
+ // [Required]
+ // public int Order { get; set; }
+ public int Year { get; set; }
+ public double? RestCount { get; set; }
+ public double? RestDay { get; set; }
+ public double? SickCount { get; set; }
+ public double? SickDay { get; set; }
+ public double? AbsentCount { get; set; }
+ public double? AbsentDay { get; set; }
+ public double? LateCount { get; set; }
+ public double? LateDay { get; set; }
+ public double? OtherCount { get; set; }
+ public double? OtherDay { get; set; }
+ public double? PersonalCount { get; set; }
+ public double? PersonalDay { get; set; }
+ public double? MaternityCount { get; set; }
+ public double? MaternityDay { get; set; }
+ public double? WifeCount { get; set; }
+ public double? WifeDay { get; set; }
+ public double? OrdainCount { get; set; }
+ public double? OrdainDay { get; set; }
+ public double? MilitaryCount { get; set; }
+ public double? MilitaryDay { get; set; }
+ public double? StudyCount { get; set; }
+ public double? StudyDay { get; set; }
+ public double? AgencyCount { get; set; }
+ public double? AgencyDay { get; set; }
+ public double? CoupleCount { get; set; }
+ public double? CoupleDay { get; set; }
+ public double? TherapyCount { get; set; }
+ public double? TherapyDay { get; set; }
+ // public int? Year { get; set; }
+ // public double? Holiday { get; set; }
+ // public double? Sick { get; set; }
+ // public double? Government { get; set; }
+ // public double? Late { get; set; }
+ // public double? Other { get; set; }
+ // public double? Business { get; set; }
+ // public double? Maternity { get; set; }
+ // public double? HelpMaternity { get; set; }
+ // public double? Ordination { get; set; }
+ // public double? Study { get; set; }
+ // public double? International { get; set; }
+ // public double? Spouse { get; set; }
+ // public double? Rehabilitation { get; set; }
+ public virtual List ProfileLeaveHistorys { get; set; } = new List();
+ public virtual Profile? Profile { get; set; }
+ }
+}
diff --git a/Models/HR/ProfileLeaveHistory.cs b/Models/HR/ProfileLeaveHistory.cs
new file mode 100644
index 0000000..018ce42
--- /dev/null
+++ b/Models/HR/ProfileLeaveHistory.cs
@@ -0,0 +1,53 @@
+using System.ComponentModel.DataAnnotations;
+using BMA.EHR.Report.Service.Models;
+
+namespace BMA.EHR.Profile.Service.Models.HR
+{
+ public class ProfileLeaveHistory : EntityBase
+ {
+ public int Year { get; set; }
+ public double? RestCount { get; set; }
+ public double? RestDay { get; set; }
+ public double? SickCount { get; set; }
+ public double? SickDay { get; set; }
+ public double? AbsentCount { get; set; }
+ public double? AbsentDay { get; set; }
+ public double? LateCount { get; set; }
+ public double? LateDay { get; set; }
+ public double? OtherCount { get; set; }
+ public double? OtherDay { get; set; }
+ public double? PersonalCount { get; set; }
+ public double? PersonalDay { get; set; }
+ public double? MaternityCount { get; set; }
+ public double? MaternityDay { get; set; }
+ public double? WifeCount { get; set; }
+ public double? WifeDay { get; set; }
+ public double? OrdainCount { get; set; }
+ public double? OrdainDay { get; set; }
+ public double? MilitaryCount { get; set; }
+ public double? MilitaryDay { get; set; }
+ public double? StudyCount { get; set; }
+ public double? StudyDay { get; set; }
+ public double? AgencyCount { get; set; }
+ public double? AgencyDay { get; set; }
+ public double? CoupleCount { get; set; }
+ public double? CoupleDay { get; set; }
+ public double? TherapyCount { get; set; }
+ public double? TherapyDay { get; set; }
+ // public int? Year { get; set; }
+ // public double? Holiday { get; set; }
+ // public double? Sick { get; set; }
+ // public double? Government { get; set; }
+ // public double? Late { get; set; }
+ // public double? Other { get; set; }
+ // public double? Business { get; set; }
+ // public double? Maternity { get; set; }
+ // public double? HelpMaternity { get; set; }
+ // public double? Ordination { get; set; }
+ // public double? Study { get; set; }
+ // public double? International { get; set; }
+ // public double? Spouse { get; set; }
+ // public double? Rehabilitation { get; set; }
+ public virtual ProfileLeave? ProfileLeave { get; set; }
+ }
+}
diff --git a/Models/HR/ProfileMotherHistory.cs b/Models/HR/ProfileMotherHistory.cs
new file mode 100644
index 0000000..fedac87
--- /dev/null
+++ b/Models/HR/ProfileMotherHistory.cs
@@ -0,0 +1,30 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+
+namespace BMA.EHR.Profile.Service.Models.HR
+{
+ public class ProfileMotherHistory
+ {
+ [Key]
+ public int Id { get; set; }
+
+ [Required]
+ [MaxLength(50)]
+ public string Prefix { get; set; }
+
+ [Required]
+ [MaxLength(100)]
+ public string FirstName { get; set; }
+
+ [Required]
+ [MaxLength(100)]
+ public string LastName { get; set; }
+
+ [MaxLength(100)]
+ public string Career { get; set; }
+
+ public DateTime CreatedDate { get; set; } = DateTime.Now;
+
+ public Profile Profile { get; set; }
+ }
+}
diff --git a/Models/HR/ProfileNopaid.cs b/Models/HR/ProfileNopaid.cs
new file mode 100644
index 0000000..3818024
--- /dev/null
+++ b/Models/HR/ProfileNopaid.cs
@@ -0,0 +1,26 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using BMA.EHR.Report.Service.Models;
+
+namespace BMA.EHR.Profile.Service.Models.HR
+{
+ public class ProfileNopaid : EntityBase
+ {
+ // [Key]
+ // public int Id { get; set; }
+ // [Required]
+ // public int Order { get; set; }
+ // [MaxLength(20)]
+ // public string No { get; set; }
+ // [MaxLength(200)]
+ // public string Issuer { get; set; }
+ // [MaxLength(2000)]
+ // public string Detail { get; set; }
+ // public DateTime IssueDate { get; set; }
+ public DateTime? Date { get; set; }
+ public string? Detail { get; set; }
+ public string? Reference { get; set; }
+ public virtual List