ย้ายมาออกรายงานผ่านระบบ

This commit is contained in:
Suphonchai Phoonsawat 2023-05-10 20:11:47 +07:00
parent 4987f7c5ad
commit b817b781d2
144 changed files with 5573 additions and 63 deletions

View file

@ -26,14 +26,15 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="AWSSDK.S3" Version="3.7.103.35" />
<PackageReference Include="BMA.EHR.Core" Version="1.0.0" />
<PackageReference Include="BMA.EHR.Extensions" Version="1.0.1" />
<PackageReference Include="itext7" Version="7.2.5" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.5" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.5">
@ -56,11 +57,27 @@
<PackageReference Include="Serilog.Sinks.Elasticsearch" Version="9.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.5.0" />
<PackageReference Include="ThaiBahtText" Version="1.0.103" />
<PackageReference Include="WatchDog.NET" Version="1.4.6" />
<PackageReference Include="Telerik.Reporting" Version="17.0.23.315" />
</ItemGroup>
<ItemGroup>
<None Update="Report\Organization\rptAccount1.trdp">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Report\Profile\rptKK1Summary.trbp">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Report\Profile\rptKK1_Page2.trdp">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Report\Profile\rptKK1_Page1.trdp">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Report\Profile\rptShortKp7.trdp">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Report\Recruit\rptCertificate1.trdp">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>

View file

@ -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
/// <summary>
/// แสดงหนังสือรับรอง
/// </summary>
/// <param name="id">รหัสรอบการสอบ</param>
/// <param name="examId">เลขประจำตัวผู้สมัครสอบ</param>
/// <param name="type">ชนิดของรายงาน</param>
/// <returns></returns>
/// <response code="200">เมื่อแสดงรายงานสำเร็จ</response>
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpGet("certificate/{type:int}/{id:length(36)}/{examId}")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
public async Task<ActionResult<ResponseObject>> 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, "เกิดข้อผิดพลาดในการแสดงรายงาน");
}
}
/// <summary>
/// แสดงเอกสารผลสอบ
/// </summary>
/// <param name="id">รหัสรอบการสอบ</param>
/// <param name="examId">เลขประจำตัวผู้สมัครสอบ</param>
/// <returns></returns>
/// <response code="200">เมื่อแสดงรายงานสำเร็จ</response>
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpGet("score/{id:length(36)}/{examId}")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
public async Task<ActionResult<ResponseObject>> 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
}
}

View file

@ -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
{
}
}

View file

@ -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 "
/// <summary>
/// แสดงหนังสือรับรอง
/// </summary>
/// <param name="id">รหัสข้อมูลข้าราชการ</param>
/// <returns></returns>
/// <response code="200">เมื่อแสดงรายงานสำเร็จ</response>
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpGet("kp7-short/{id:length(36)}")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
public async Task<ActionResult<ResponseObject>> 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<dynamic>();
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<ActionResult<ResponseObject>> 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
}
}

11
Core/GlobalMessages.cs Normal file
View file

@ -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 = "ไม่พบข้อมูลในระบบ";
}
}

View file

@ -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<RecruitDocument> RecruitDocuments { get; set; }
public DbSet<RecruitImportHistory> RecruitImportHistories { get; set; }
}
}

225
Data/EHRDbContext.cs Normal file
View file

@ -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<EHRDbContext> options)
: base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
//base.OnModelCreating(modelBuilder);
//modelBuilder.Ignore<Document>();
//modelBuilder.Ignore<RecruitImport>();
//modelBuilder.Ignore<Recruit.Service.Models.Recruits.Recruit>();
//modelBuilder.Ignore<RecruitAddress>();
//modelBuilder.Ignore<RecruitOccupation>();
//modelBuilder.Ignore<RecruitCertificate>();
//modelBuilder.Ignore<RecruitEducation>();
//modelBuilder.Ignore<ScoreImport>();
//modelBuilder.Ignore<RecruitScore>();
//modelBuilder.Ignore<RecruitPayment>();
//modelBuilder.Ignore<RecruitDocument>();
//modelBuilder.Ignore<RecruitImportHistory>();
}
public DbSet<Document> Documents { get; set; }
#region " From Existing DB "
public DbSet<AvailablePositionLevelEntity> AvailablePositionLevels { get; set; }
public DbSet<PositionMasterEntity> PositionMasters { get; set; }
public DbSet<OrganizationEntity> Organizations { get; set; }
public DbSet<PositionNumberEntity> PositionNumbers { get; set; }
public DbSet<OrganizationPositionEntity> OrganizationPositions { get; set; }
public DbSet<Prefix> Prefixes { get; set; }
public DbSet<BloodGroup> BloodGroups { get; set; }
public DbSet<Gender> Genders { get; set; }
public DbSet<PhysicalStatus> PhysicalStatuses { get; set; }
public DbSet<Religion> Religions { get; set; }
public DbSet<EducationLevel> EducationLevels { get; set; }
public DbSet<PositionPath> PositionPaths { get; set; }
public DbSet<PositionType> PositionTypes { get; set; }
public DbSet<PositionEmployeePosition> PositionEmployeePositions { get; set; }
public DbSet<PositionEmployeePositionSide> PositionEmployeePositionSides { get; set; }
public DbSet<PositionEmployeeGroup> PositionEmployeeGroups { get; set; }
public DbSet<PositionEmployeeLine> PositionEmployeeLines { get; set; }
public DbSet<PositionEmployeeLevel> PositionEmployeeLevels { get; set; }
public DbSet<PositionEmployeeStatus> PositionEmployeeStatuses { get; set; }
public DbSet<PositionLine> PositionLines { get; set; }
public DbSet<PositionExecutive> PositionExecutives { get; set; }
public DbSet<PositionStatus> PositionStatuss { get; set; }
public DbSet<PositionLevel> PositionLevels { get; set; }
public DbSet<Relationship> Relationships { get; set; }
public DbSet<Position> Positions { get; set; }
public DbSet<PositionPathSide> PositionPathSides { get; set; }
public DbSet<PositionExecutiveSide> PositionExecutiveSides { get; set; }
public DbSet<InsigniaType> InsigniaTypes { get; set; }
public DbSet<Insignia> Insignias { get; set; }
public DbSet<Province> Provinces { get; set; }
public DbSet<District> Districts { get; set; }
public DbSet<SubDistrict> SubDistricts { get; set; }
public DbSet<Holiday> Holidays { get; set; }
public DbSet<OrganizationType> OrganizationTypes { get; set; }
public DbSet<OrganizationLevel> OrganizationLevels { get; set; }
public DbSet<OrganizationOrganization> OrganizationOrganizations { get; set; }
public DbSet<OrganizationShortName> OrganizationShortNames { get; set; }
public DbSet<OrganizationStatus> OrganizationStatuses { get; set; }
public DbSet<OrganizationAgency> OrganizationAgencys { get; set; }
public DbSet<OrganizationGovernmentAgency> OrganizationGovernmentAgencys { get; set; }
public DbSet<OrganizationTelExternal> OrganizationTelExternals { get; set; }
public DbSet<OrganizationTelInternal> OrganizationTelInternals { get; set; }
public DbSet<OrganizationFax> OrganizationFaxs { get; set; }
public DbSet<RoyalHierarchy> RoyalHierarchys { get; set; }
public DbSet<RoyalType> RoyalTypes { get; set; }
public DbSet<Royal> Royals { get; set; }
#endregion
public DbSet<Profile.Service.Models.HR.Profile> Profiles { get; set; }
public DbSet<ProfileEducation> ProfileEducations { get; set; }
public DbSet<ProfileEducationHistory> ProfileEducationHistorys { get; set; }
public DbSet<ProfileHonor> ProfileHonors { get; set; }
public DbSet<ProfileHonorHistory> ProfileHonorHistorys { get; set; }
public DbSet<ProfileAssessment> ProfileAssessments { get; set; }
public DbSet<ProfileAssessmentHistory> ProfileAssessmentHistorys { get; set; }
public DbSet<ProfileDiscipline> ProfileDisciplines { get; set; }
public DbSet<ProfileDisciplineHistory> ProfileDisciplineHistorys { get; set; }
public DbSet<ProfileCertificate> ProfileCertificates { get; set; }
public DbSet<ProfileCertificateHistory> ProfileCertificateHistorys { get; set; }
public DbSet<ProfileTraining> ProfileTrainings { get; set; }
public DbSet<ProfileTrainingHistory> ProfileTrainingHistorys { get; set; }
public DbSet<ProfileInsignia> ProfileInsignias { get; set; }
public DbSet<ProfileInsigniaHistory> ProfileInsigniaHistorys { get; set; }
public DbSet<ProfileSalary> ProfileSalaries { get; set; }
public DbSet<ProfileSalaryHistory> ProfileSalaryHistories { get; set; }
public DbSet<ProfileSalaryOrganization> ProfileSalaryOrganizations { get; set; }
public DbSet<ProfileSalaryPosition> ProfileSalaryPositions { get; set; }
public DbSet<ProfileSalaryPositionNumber> ProfileSalaryPositionsNumbers { get; set; }
public DbSet<ProfileHistory> ProfileHistory { get; set; }
public DbSet<ProfileCoupleHistory> ProfileCoupleHistory { get; set; }
public DbSet<ProfileFatherHistory> ProfileFatherHistory { get; set; }
public DbSet<ProfileMotherHistory> ProfileMotherHistory { get; set; }
public DbSet<ProfileFamilyHistory> ProfileFamilyHistory { get; set; }
public DbSet<ProfileGovernmentHistory> ProfileGovernmentHistory { get; set; }
public DbSet<ProfileLeave> ProfileLeaves { get; set; }
public DbSet<ProfileLeaveHistory> ProfileLeaveHistorys { get; set; }
public DbSet<ProfileSalaryPositionLevel> ProfileSalaryPositionLevels { get; set; }
public DbSet<ProfileSalaryPositionType> ProfileSalaryPositionTypes { get; set; }
public DbSet<ProfileChildren> ProfileChildrens { get; set; }
public DbSet<ProfileChildrenHistory> ProfileChildrenHistories { get; set; }
public DbSet<ProfilePaper> ProfilePapers { get; set; }
public DbSet<ProfileCurrentAddressHistory> ProfileCurrentAddressHistories { get; set; }
public DbSet<ProfileRegistrationAddressHistory> ProfileRegistrationAddressHistories { get; set; }
public DbSet<ProfileAddressHistory> ProfileAddressHistories { get; set; }
public DbSet<ProfileOther> ProfileOthers { get; set; }
public DbSet<ProfileOtherHistory> ProfileOtherHistorys { get; set; }
public DbSet<ProfileAbility> ProfileAbilitys { get; set; }
public DbSet<ProfileAbilityHistory> ProfileAbilityHistorys { get; set; }
public DbSet<ProfileDuty> ProfileDutys { get; set; }
public DbSet<ProfileDutyHistory> ProfileDutyHistorys { get; set; }
public DbSet<ProfileNopaid> ProfileNopaids { get; set; }
public DbSet<ProfileNopaidHistory> ProfileNopaidHistorys { get; set; }
public DbSet<ProfileAvatarHistory> ProfileAvatarHistories { get; set; }
public DbSet<ProfilePosition> ProfilePositions { get; set; }
}
}

79
Data/ExamDbContext.cs Normal file
View file

@ -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<ExamDbContext> options)
: base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
//base.OnModelCreating(modelBuilder);
//modelBuilder.Ignore<Document>();
//modelBuilder.Ignore<RecruitImport>();
//modelBuilder.Ignore<Recruit.Service.Models.Recruits.Recruit>();
//modelBuilder.Ignore<RecruitAddress>();
//modelBuilder.Ignore<RecruitOccupation>();
//modelBuilder.Ignore<RecruitCertificate>();
//modelBuilder.Ignore<RecruitEducation>();
//modelBuilder.Ignore<ScoreImport>();
//modelBuilder.Ignore<RecruitScore>();
//modelBuilder.Ignore<RecruitPayment>();
//modelBuilder.Ignore<RecruitDocument>();
//modelBuilder.Ignore<RecruitImportHistory>();
}
public DbSet<PeriodExam> PeriodExams { get; set; }
public DbSet<Candidate> Candidates { get; set; }
public DbSet<Career> Careers { get; set; }
public DbSet<Education> Educations { get; set; }
public DbSet<Document> Documents { get; set; }
public DbSet<CandidateDocument> CandidateDocuments { get; set; }
public DbSet<PositionExam> PositionExams { get; set; }
public DbSet<BankExam> BankExams { get; set; }
public DbSet<PeriodExamDocument> PeriodExamDocuments { get; set; }
public DbSet<PeriodExamImage> PeriodExamImages { get; set; }
public DbSet<CMSCandidate> CMSCandidates { get; set; }
public DbSet<CMSAgency> CMSAgencys { get; set; }
public DbSet<CMSGovernment> CMSGovernments { get; set; }
public DbSet<Disable> Disables { get; set; }
public DbSet<DisableAddress> DisableAddresses { get; set; }
public DbSet<DisableOccupation> DisableOccupations { get; set; }
public DbSet<DisableCertificate> DisableCertificates { get; set; }
public DbSet<DisableEducation> DisableEducations { get; set; }
public DbSet<ScoreImport> ScoreImports { get; set; }
public DbSet<DisableScore> DisableScores { get; set; }
public DbSet<DisablePayment> DisablePayments { get; set; }
public DbSet<DisableDocument> DisableDocuments { get; set; }
public DbSet<DisableImportHistory> DisableImportHistories { get; set; }
}
}

View file

@ -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; }
}
}

20
Models/Exam/BankExam.cs Normal file
View file

@ -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; }
}
}

17
Models/Exam/CMSAgency.cs Normal file
View file

@ -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; }
}
}

View file

@ -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<CMSAgency> CMSAgencys { get; set; } = new List<CMSAgency>();
public List<CMSGovernment> CMSGovernments { get; set; } = new List<CMSGovernment>();
}
}

View file

@ -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; }
}
}

256
Models/Exam/Candidate.cs Normal file
View file

@ -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; }
}
}

View file

@ -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; }
}
}

30
Models/Exam/Career.cs Normal file
View file

@ -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;
}
}

View file

@ -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<DisableAddress> Addresses { get; set; } = new List<DisableAddress>();
public virtual List<DisableOccupation> Occupations { get; set; } = new List<DisableOccupation>();
public virtual List<DisableCertificate> Certificates { get; set; } = new List<DisableCertificate>();
public virtual List<DisableEducation> Educations { get; set; } = new List<DisableEducation>();
public virtual List<DisablePayment> Payments { get; set; } = new List<DisablePayment>();
public virtual List<DisableDocument> Documents { get; set; } = new List<DisableDocument>();
public DateTime CreatedDate { get; set; } = DateTime.Now;
public DateTime ModifiedDate { get; set; }
public DateTime ApplyDate { get; set; }
public string? PositionName { get; set; }
}
}

View file

@ -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; }
}
}

View file

@ -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; }
}
}

View file

@ -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; }
}
}

View file

@ -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; }
}
}

View file

@ -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; }
}
}

View file

@ -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; }
}
}

View file

@ -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; }
}
}

View file

@ -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; }
}
}

View file

@ -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<DisableScore> Scores { get; set; } = new List<DisableScore>();
[ForeignKey("FK_Score_Import_ID")]
public Guid PeriodExamId { get; set; }
public PeriodExam PeriodExam { get; set; }
}
}

19
Models/Exam/District.cs Normal file
View file

@ -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<SubDistrict> SubDistricts { get; set; } = new();
public virtual Province? Province { get; set; }
}
}

33
Models/Exam/Education.cs Normal file
View file

@ -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;
}
}

View file

@ -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;
}
}

32
Models/Exam/EntityBase.cs Normal file
View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}

105
Models/Exam/PeriodExam.cs Normal file
View file

@ -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> Candidate { get; set; } = new List<Candidate>();
[Comment("ตำแหน่งสมัคร")]
public List<PositionExam> PositionExam { get; set; } = new List<PositionExam>();
[Comment("ช่องทางชำระเงิน")]
public List<BankExam> BankExam { get; set; } = new List<BankExam>();
[Comment("เอกสารอื่นๆ")]
public virtual List<PeriodExamDocument> PeriodExamDocuments { get; set; } = new();
[Comment("รูป")]
public virtual List<PeriodExamImage> PeriodExamImages { get; set; } = new();
public Document? ImportFile { get; set; } = new Document();
public List<Disable> Disables { get; set; } = new List<Disable>();
public ScoreImport? ScoreImport { get; set; }
public List<DisableImportHistory> ImportHostories { get; set; } = new List<DisableImportHistory>();
}
}

View file

@ -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; }
}
}

View file

@ -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; }
}
}

View file

@ -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; }
}
}

15
Models/Exam/Prefix.cs Normal file
View file

@ -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;
}
}

17
Models/Exam/Province.cs Normal file
View file

@ -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<District> Districts { get; set; } = new();
}
}

View file

@ -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;
}

15
Models/Exam/Religion.cs Normal file
View file

@ -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;
}
}

View file

@ -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; }
}
}

264
Models/HR/Profile.cs Normal file
View file

@ -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<ProfileEducation> Educations { get; set; } = new List<ProfileEducation>();
public virtual List<ProfileHonor> Honors { get; set; } = new List<ProfileHonor>();
public virtual List<ProfileAssessment> Assessments { get; set; } = new List<ProfileAssessment>();
public virtual List<ProfileDiscipline> Disciplines { get; set; } = new List<ProfileDiscipline>();
public virtual List<ProfileCertificate> Certificates { get; set; } = new List<ProfileCertificate>();
public virtual List<ProfileTraining> Trainings { get; set; } = new List<ProfileTraining>();
public virtual List<ProfileInsignia> Insignias { get; set; } = new List<ProfileInsignia>();
public virtual List<ProfileSalary> Salaries { get; set; } = new List<ProfileSalary>();
public virtual List<ProfileHistory> ProfileHistory { get; set; } = new List<ProfileHistory>();
public virtual List<ProfileCoupleHistory> CoupleHistory { get; set; } = new List<ProfileCoupleHistory>();
public virtual List<ProfileFatherHistory> FatherHistory { get; set; } = new List<ProfileFatherHistory>();
public virtual List<ProfileMotherHistory> MotherHistory { get; set; } = new List<ProfileMotherHistory>();
public virtual List<ProfileFamilyHistory> FamilyHistory { get; set; } = new List<ProfileFamilyHistory>();
public virtual List<ProfileGovernmentHistory> GovernmentHistory { get; set; } = new List<ProfileGovernmentHistory>();
public virtual List<ProfileLeave> Leaves { get; set; } = new List<ProfileLeave>();
public virtual List<ProfileCurrentAddressHistory> CurrentAddressHistory { get; set; } = new List<ProfileCurrentAddressHistory>();
public virtual List<ProfileRegistrationAddressHistory> RegistrationAddressHistory { get; set; } = new List<ProfileRegistrationAddressHistory>();
public virtual List<ProfileAddressHistory> AddressHistory { get; set; } = new List<ProfileAddressHistory>();
public virtual List<ProfileOther> Others { get; set; } = new List<ProfileOther>();
public virtual List<ProfileAbility> Abilitys { get; set; } = new List<ProfileAbility>();
public virtual List<ProfileDuty> Dutys { get; set; } = new List<ProfileDuty>();
public virtual List<ProfileNopaid> Nopaids { get; set; } = new List<ProfileNopaid>();
public virtual List<ProfileAvatarHistory> AvatarHistory { get; set; } = new List<ProfileAvatarHistory>();
public virtual List<ProfilePaper> Papers { get; set; } = new List<ProfilePaper>();
public virtual List<ProfileChildren> Childrens { get; set; } = new List<ProfileChildren>();
}
}

View file

@ -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
{
/// <summary>
/// ด้าน (ใช้เฉพาะ ความสามารถพิเศษ)
/// </summary>
public string? Field { get; set; }
/// <summary>
/// รายละเอียด
/// </summary>
public string? Detail { get; set; }
/// <summary>
/// หมายเหตุ
/// </summary>
public string? Remark { get; set; }
/// <summary>
/// วันที่เริ่มต้น
/// </summary>
public DateTime? DateStart { get; set; }
/// <summary>
/// วันที่สิ้นสุด
/// </summary>
public DateTime? DateEnd { get; set; }
/// <summary>
/// เอกสารอ้างอิง
/// </summary>
public string? Reference { get; set; }
// public string? Side { get; set; }
// public string? Detail { get; set; }
// public string? Note { get; set; }
public virtual List<ProfileAbilityHistory> ProfileAbilityHistorys { get; set; } = new List<ProfileAbilityHistory>();
public virtual Profile? Profile { get; set; }
}
}

View file

@ -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
{
/// <summary>
/// ด้าน (ใช้เฉพาะ ความสามารถพิเศษ)
/// </summary>
public string? Field { get; set; }
/// <summary>
/// รายละเอียด
/// </summary>
public string? Detail { get; set; }
/// <summary>
/// หมายเหตุ
/// </summary>
public string? Remark { get; set; }
/// <summary>
/// วันที่เริ่มต้น
/// </summary>
public DateTime? DateStart { get; set; }
/// <summary>
/// วันที่สิ้นสุด
/// </summary>
public DateTime? DateEnd { get; set; }
/// <summary>
/// เอกสารอ้างอิง
/// </summary>
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; }
}
}

View file

@ -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; }
}
}

View file

@ -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<ProfileAssessmentHistory> ProfileAssessmentHistorys { get; set; } = new List<ProfileAssessmentHistory>();
public virtual Profile? Profile { get; set; }
}
}

View file

@ -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; }
}
}

View file

@ -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; }
}
}

View file

@ -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<ProfileCertificateHistory> ProfileCertificateHistorys { get; set; } = new List<ProfileCertificateHistory>();
public virtual Profile? Profile { get; set; }
}
}

View file

@ -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; }
}
}

View file

@ -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<ProfileChildrenHistory> ProfileChildrenHistorys { get; set; } = new List<ProfileChildrenHistory>();
public Profile? Profile { get; set; }
}
}

View file

@ -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; }
}
}

View file

@ -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; }
}
}

View file

@ -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; }
}
}

View file

@ -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<ProfileDisciplineHistory> ProfileDisciplineHistorys { get; set; } = new List<ProfileDisciplineHistory>();
public virtual Profile? Profile { get; set; }
}
}

View file

@ -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; }
}
}

16
Models/HR/ProfileDuty.cs Normal file
View file

@ -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<ProfileDutyHistory> ProfileDutyHistorys { get; set; } = new List<ProfileDutyHistory>();
public virtual Profile? Profile { get; set; }
}
}

View file

@ -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; }
}
}

View file

@ -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<ProfileEducationHistory> ProfileEducationHistorys { get; set; } = new List<ProfileEducationHistory>();
public virtual Profile? Profile { get; set; }
}
}

View file

@ -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; }
}
}

View file

@ -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<ProfileChildrenHistory> Childrens { get; set; } = new List<ProfileChildrenHistory>();
}
}

View file

@ -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; }
}
}

View file

@ -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; }
}
}

View file

@ -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; }
}
}

28
Models/HR/ProfileHonor.cs Normal file
View file

@ -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<ProfileHonorHistory> ProfileHonorHistorys { get; set; } = new List<ProfileHonorHistory>();
public virtual Profile? Profile { get; set; }
}
}

View file

@ -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; }
}
}

View file

@ -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<ProfileInsigniaHistory> ProfileInsigniaHistorys { get; set; } = new List<ProfileInsigniaHistory>();
public virtual Profile? Profile { get; set; }
}
}

View file

@ -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; }
}
}

58
Models/HR/ProfileLeave.cs Normal file
View file

@ -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<ProfileLeaveHistory> ProfileLeaveHistorys { get; set; } = new List<ProfileLeaveHistory>();
public virtual Profile? Profile { get; set; }
}
}

View file

@ -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; }
}
}

View file

@ -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; }
}
}

View file

@ -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<ProfileNopaidHistory> ProfileNopaidHistorys { get; set; } = new List<ProfileNopaidHistory>();
public virtual Profile? Profile { get; set; }
}
}

View file

@ -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 ProfileNopaidHistory : EntityBase
{
public DateTime? Date { get; set; }
public string? Detail { get; set; }
public string? Reference { get; set; }
public virtual ProfileNopaid? ProfileNopaid { get; set; }
}
}

15
Models/HR/ProfileOther.cs Normal file
View file

@ -0,0 +1,15 @@
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 ProfileOther : EntityBase
{
public DateTime? Date { get; set; }
public string? Detail { get; set; }
public virtual List<ProfileOtherHistory> ProfileOtherHistorys { get; set; } = new List<ProfileOtherHistory>();
public Profile? Profile { get; set; }
}
}

View file

@ -0,0 +1,14 @@
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 ProfileOtherHistory : EntityBase
{
public DateTime? Date { get; set; }
public string? Detail { get; set; }
public ProfileOther? ProfileOther { get; set; }
}
}

18
Models/HR/ProfilePaper.cs Normal file
View file

@ -0,0 +1,18 @@
using BMA.EHR.Recruit.Service.Models.Documents;
using System.ComponentModel.DataAnnotations;
using BMA.EHR.Report.Service.Models;
namespace BMA.EHR.Profile.Service.Models.HR
{
public class ProfilePaper : EntityBase
{
// [Key]
// public int Id { get; set; }
[Required, MaxLength(255)]
public string? Detail { get; set; }
[Required, MaxLength(255)]
public string? CategoryName { get; set; }
public Document Document { get; set; }
public virtual Profile Profile { get; set; }
}
}

View file

@ -0,0 +1,33 @@
using System;
using System.ComponentModel.DataAnnotations;
namespace BMA.EHR.Profile.Service.Models.HR
{
public class ProfileRegistrationAddressHistory
{
[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; }
}
}

View file

@ -0,0 +1,25 @@
using BMA.EHR.MetaData.Service.Models;
namespace BMA.EHR.Profile.Service.Models.HR
{
public class ProfileSalary : EntityBase
{
public DateTime? Date { get; set; }
public double? Amount { get; set; }
public double? PositionSalaryAmount { get; set; }
public Guid? OcId { get; set; }
public Guid? OrganizationShortNameId { get; set; }
public Guid? PositionId { get; set; }
public Guid? PosNoId { get; set; }
public Guid? PositionLineId { get; set; }
public Guid? PositionPathSideId { get; set; }
public Guid? PositionTypeId { get; set; }
public Guid? PositionLevelId { get; set; }
public Guid? PositionExecutiveId { get; set; }
public Guid? PositionExecutiveSideId { get; set; }
public string? SalaryClass { get; set; }
public string? SalaryRef { get; set; }
public virtual List<ProfileSalaryHistory> ProfileSalaryHistorys { get; set; } = new List<ProfileSalaryHistory>();
public virtual Profile? Profile { get; set; }
}
}

View file

@ -0,0 +1,34 @@
using BMA.EHR.MetaData.Service.Models;
namespace BMA.EHR.Profile.Service.Models.HR
{
public class ProfileSalaryHistory : EntityBase
{
public DateTime? Date { get; set; }
public double? Amount { get; set; }
public double? PositionSalaryAmount { get; set; }
public Guid? OcId { get; set; }
public string? Oc { get; set; }
public Guid? OrganizationShortNameId { get; set; }
public string? OrganizationShortName { 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; }
public string? SalaryClass { get; set; }
public string? SalaryRef { get; set; }
public virtual ProfileSalary? ProfileSalary { get; set; }
}
}

View file

@ -0,0 +1,19 @@
using BMA.EHR.Profile.Service.Models;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace BMA.EHR.Profile.Service.Models.HR
{
public class ProfileSalaryOrganization
{
[ForeignKey("ProfileSalary")]
public int Id { get; set; }
[MaxLength(200)]
public string Comment { get; set; }
// public OrganizationEntity Organization { get; set; }
// public ProfileSalary ProfileSalary { get; set; }
}
}

View file

@ -0,0 +1,19 @@
using BMA.EHR.MetaData.Service.Models;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace BMA.EHR.Profile.Service.Models.HR
{
public class ProfileSalaryPosition
{
[ForeignKey("ProfileSalary")]
public int Id { get; set; }
[MaxLength(200)]
public string Comment { get; set; }
public Position Position { get; set; }
// public ProfileSalary ProfileSalary { get; set; }
}
}

View file

@ -0,0 +1,20 @@
using BMA.EHR.MetaData.Service.Models;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace BMA.EHR.Profile.Service.Models.HR
{
public class ProfileSalaryPositionLevel
{
[ForeignKey("ProfileSalary")]
public int Id { get; set; }
[MaxLength(200)]
public string Comment { get; set; }
// public PositionLevel PositionLevel { get; set; }
// public ProfileSalary ProfileSalary { get; set; }
}
}

View file

@ -0,0 +1,19 @@
using BMA.EHR.Profile.Service.Models;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace BMA.EHR.Profile.Service.Models.HR
{
public class ProfileSalaryPositionNumber
{
[ForeignKey("ProfileSalary")]
public int Id { get; set; }
[MaxLength(200)]
public string Comment { get; set; }
// public PositionNumberEntity PositionNumber { get; set; }
// public ProfileSalary ProfileSalary { get; set; }
}
}

View file

@ -0,0 +1,22 @@
using BMA.EHR.MetaData.Service.Models;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace BMA.EHR.Profile.Service.Models.HR
{
public class ProfileSalaryPositionType
{
[ForeignKey("ProfileSalary")]
public int Id { get; set; }
[MaxLength(200)]
public string Comment { get; set; }
// public PositionType PositionType { get; set; }
// public ProfileSalary ProfileSalary { get; set; }
}
}

View file

@ -0,0 +1,34 @@
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 ProfileTraining : EntityBase
{
[MaxLength(100)]
public string? Subject { get; set; }
[Column(TypeName = "text")]
public string? Detail { get; set; }
[MaxLength(200)]
public string? Host { get; set; }
[MaxLength(200)]
public string? ClassName { get; set; }
[MaxLength(200)]
public string? Place { get; set; }
[MaxLength(50)]
public string? Reference { get; set; }
public DateTime? StartDate { get; set; }
public DateTime? EndDate { get; set; }
// public string? Course { get; set; }
// public DateTime? Start { get; set; }
// public DateTime? End { get; set; }
// public string? Location { get; set; }
// public string? Detail { get; set; }
// public string? Organize { get; set; }
// public string? Gen { get; set; }
public virtual List<ProfileTrainingHistory> ProfileTrainingHistorys { get; set; } = new List<ProfileTrainingHistory>();
public virtual Profile? Profile { get; set; }
}
}

View file

@ -0,0 +1,33 @@
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 ProfileTrainingHistory : EntityBase
{
[MaxLength(100)]
public string? Subject { get; set; }
[Column(TypeName = "text")]
public string? Detail { get; set; }
[MaxLength(200)]
public string? Host { get; set; }
[MaxLength(200)]
public string? ClassName { get; set; }
[MaxLength(200)]
public string? Place { get; set; }
[MaxLength(50)]
public string? Reference { get; set; }
public DateTime? StartDate { get; set; }
public DateTime? EndDate { get; set; }
// public string? Course { get; set; }
// public DateTime? Start { get; set; }
// public DateTime? End { get; set; }
// public string? Location { get; set; }
// public string? Detail { get; set; }
// public string? Organize { get; set; }
// public string? Gen { get; set; }
public virtual ProfileTraining? ProfileTraining { get; set; }
}
}

View file

@ -0,0 +1,15 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
namespace BMA.EHR.MetaData.Service.Models
{
public class BloodGroup : EntityBase
{
[Required, MaxLength(2), Column(Order = 1), Comment("ชื่อหมู่โลหิต")]
public string Name { get; set; } = string.Empty;
[Column(Order = 2), Comment("สถานะการใช้งาน")]
public bool IsActive { get; set; } = true;
}
}

View file

@ -0,0 +1,20 @@
using Microsoft.EntityFrameworkCore;
using Org.BouncyCastle.Asn1.X509;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
namespace BMA.EHR.MetaData.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<SubDistrict> SubDistricts { get; set; } = new();
public virtual Province? Province { get; set; }
}
}

View file

@ -0,0 +1,15 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
namespace BMA.EHR.MetaData.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;
}
}

View file

@ -0,0 +1,32 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;
namespace BMA.EHR.MetaData.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;
}
}

15
Models/MetaData/Gendor.cs Normal file
View file

@ -0,0 +1,15 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
namespace BMA.EHR.MetaData.Service.Models
{
public class Gender : EntityBase
{
[Required, MaxLength(20), Column(Order = 1), Comment("เพศ")]
public string Name { get; set; } = string.Empty;
[Column(Order = 2), Comment("สถานะการใช้งาน")]
public bool IsActive { get; set; } = true;
}
}

View file

@ -0,0 +1,27 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace BMA.EHR.MetaData.Service.Models
{
public class Holiday : EntityBase
{
[Required, Column(Order = 1), Comment("ประจำปี")]
public int Year { get; set; } = 0;
[Required, Column(Order = 2), Comment("วันหยุด")]
public DateTime HolidayDate { get; set; } = DateTime.Now.Date;
[Required, Column(Order = 3), Comment("วันหยุด(Original)")]
public DateTime OriginalDate { get; set; } = DateTime.Now.Date;
[Required, MaxLength(250), Column(Order = 4), Comment("ชื่อวันหยุด")]
public string Name { get; set; } = string.Empty;
[Required, Column(Order = 5), Comment("เป็นวันหยุดพิเศษหรือไม่")]
public bool IsSpecial { get; set; } = true;
[Required, Column(Order = 6), Comment("ประเภทของวันหยุดสำหรับ ทำงาน 5 วัน=`NORMAL`,ทำงาน 6 วัน=`6DAYS`")]
public string Category { get; set; } = "NORMAL";
}
}

View file

@ -0,0 +1,23 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
namespace BMA.EHR.MetaData.Service.Models
{
public class Insignia: EntityBase
{
[Required, MaxLength(50), Column(Order = 1), Comment("ชื่อเครื่องราชย์")]
public string Name { get; set; } = string.Empty;
[Required, MaxLength(10), Column(Order = 2), Comment("ชื่อย่อเครื่องราชย์")]
public string ShortName { get; set; } = string.Empty;
[Column(Order = 3), Comment("สถานะการใช้งาน")]
public bool IsActive { get; set; } = true;
[Column(Order = 4), Comment("ลำดับชั้นของเครื่องราชย์ เอาไว้ตรวจสอบเวลาขอว่าต้องได้ชั้นที่สูงกว่าที่เคยได้รับแล้วเท่านั้น")]
public int Level { get; set; } = 0;
public virtual InsigniaType? InsigniaType { get; set; }
}
}

View file

@ -0,0 +1,16 @@
using Microsoft.EntityFrameworkCore;
using Org.BouncyCastle.Asn1.X509;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
namespace BMA.EHR.MetaData.Service.Models
{
public class InsigniaType : 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;
}
}

View file

@ -0,0 +1,15 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace BMA.EHR.MetaData.Service.Models
{
public class OrganizationAgency : 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;
}
}

View file

@ -0,0 +1,15 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace BMA.EHR.MetaData.Service.Models
{
public class OrganizationFax : 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;
}
}

View file

@ -0,0 +1,15 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace BMA.EHR.MetaData.Service.Models
{
public class OrganizationGovernmentAgency : 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;
}
}

View file

@ -0,0 +1,15 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace BMA.EHR.MetaData.Service.Models
{
public class OrganizationLevel : 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;
}
}

View file

@ -0,0 +1,15 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace BMA.EHR.MetaData.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;
}
}

View file

@ -0,0 +1,19 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace BMA.EHR.MetaData.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;
}
}

Some files were not shown because too many files have changed in this diff Show more