2023-11-16 13:17:54 +07:00
|
|
|
|
using BMA.EHR.Application.Common.Interfaces;
|
2023-09-26 15:09:01 +07:00
|
|
|
|
using BMA.EHR.Domain.Extensions;
|
|
|
|
|
|
using BMA.EHR.Domain.Models.HR;
|
|
|
|
|
|
using BMA.EHR.Domain.Models.Placement;
|
|
|
|
|
|
using Microsoft.AspNetCore.Hosting;
|
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
|
|
|
|
|
|
|
namespace BMA.EHR.Application.Repositories.Reports
|
|
|
|
|
|
{
|
|
|
|
|
|
public class TransferReportRepository
|
|
|
|
|
|
{
|
|
|
|
|
|
#region " Fields "
|
|
|
|
|
|
|
|
|
|
|
|
private readonly IApplicationDBContext _dbContext;
|
|
|
|
|
|
private readonly IWebHostEnvironment _hostingEnvironment;
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region " Constructor and Destructor "
|
|
|
|
|
|
|
|
|
|
|
|
public TransferReportRepository(IApplicationDBContext dbContext, IWebHostEnvironment hostEnvironment)
|
|
|
|
|
|
{
|
|
|
|
|
|
_dbContext = dbContext;
|
|
|
|
|
|
_hostingEnvironment = hostEnvironment;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region " Methods "
|
|
|
|
|
|
|
2023-10-06 10:04:10 +07:00
|
|
|
|
#region 21
|
|
|
|
|
|
public async Task<dynamic> GetData1Transfer(Guid id)
|
2023-09-26 15:09:01 +07:00
|
|
|
|
{
|
|
|
|
|
|
var data = await _dbContext.Set<PlacementTransfer>().AsQueryable()
|
|
|
|
|
|
.Include(x => x.Profile)
|
|
|
|
|
|
.Where(x => x.Id == id)
|
|
|
|
|
|
.FirstOrDefaultAsync();
|
|
|
|
|
|
|
2023-10-06 10:04:10 +07:00
|
|
|
|
var profile = await _dbContext.Set<Profile>().AsQueryable()
|
|
|
|
|
|
.Include(x => x.Prefix)
|
|
|
|
|
|
.Where(x => x.Id == data.Profile.Id).FirstOrDefaultAsync();
|
|
|
|
|
|
|
|
|
|
|
|
var prefix = string.IsNullOrEmpty(profile.Prefix.Name) ? string.Empty : profile.Prefix.Name;
|
2023-09-26 15:09:01 +07:00
|
|
|
|
return new
|
|
|
|
|
|
{
|
2023-10-06 10:04:10 +07:00
|
|
|
|
CurrentDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM")).ToThaiFullDate().ToString().ToThaiNumber().Remove(0, 15),
|
|
|
|
|
|
Name = $"{prefix}{data.Profile.FirstName} {data.Profile.LastName}",
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 22
|
|
|
|
|
|
public async Task<dynamic> GetData2Transfer(Guid id)
|
|
|
|
|
|
{
|
|
|
|
|
|
var data = await _dbContext.Set<PlacementTransfer>().AsQueryable()
|
|
|
|
|
|
.Include(x => x.Profile)
|
|
|
|
|
|
.Where(x => x.Id == id)
|
|
|
|
|
|
.FirstOrDefaultAsync();
|
|
|
|
|
|
|
|
|
|
|
|
var profile = await _dbContext.Set<Profile>().AsQueryable()
|
|
|
|
|
|
.Include(x => x.Prefix)
|
|
|
|
|
|
.Where(x => x.Id == data.Profile.Id).FirstOrDefaultAsync();
|
|
|
|
|
|
|
|
|
|
|
|
var prefix = string.IsNullOrEmpty(profile.Prefix.Name) ? string.Empty : profile.Prefix.Name;
|
|
|
|
|
|
return new
|
|
|
|
|
|
{
|
|
|
|
|
|
CurrentDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM")).ToThaiFullDate().ToString().ToThaiNumber().Remove(0, 15),
|
2023-09-26 15:09:01 +07:00
|
|
|
|
Subject = $"ข้าราชการกรุงเทพมหานครสามัญขอโอน",
|
2023-10-06 10:04:10 +07:00
|
|
|
|
Name = $"{prefix}{data.Profile.FirstName} {data.Profile.LastName}",
|
2023-09-26 15:09:01 +07:00
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
2023-10-06 10:04:10 +07:00
|
|
|
|
#region 23
|
2023-09-26 15:09:01 +07:00
|
|
|
|
public async Task<dynamic> GetData3Transfer(Guid id)
|
|
|
|
|
|
{
|
|
|
|
|
|
var data = await _dbContext.Set<PlacementTransfer>().AsQueryable()
|
|
|
|
|
|
.Include(x => x.Profile)
|
|
|
|
|
|
.Where(x => x.Id == id)
|
|
|
|
|
|
.FirstOrDefaultAsync();
|
2023-10-06 10:04:10 +07:00
|
|
|
|
var profile = await _dbContext.Set<Profile>().AsQueryable()
|
|
|
|
|
|
|
|
|
|
|
|
.Include(x => x.Prefix)
|
|
|
|
|
|
.Where(x => x.Id == data.Profile.Id).FirstOrDefaultAsync();
|
|
|
|
|
|
|
|
|
|
|
|
var prefix = string.IsNullOrEmpty(profile.Prefix.Name) ? string.Empty : profile.Prefix.Name;
|
2023-09-26 15:09:01 +07:00
|
|
|
|
return new
|
|
|
|
|
|
{
|
2023-10-06 10:04:10 +07:00
|
|
|
|
CurrentDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM")).ToThaiFullDate().ToString().ToThaiNumber().Remove(0, 15),
|
2023-09-26 15:09:01 +07:00
|
|
|
|
Subject = $"ข้าราชการขอโอน",
|
2023-10-06 10:04:10 +07:00
|
|
|
|
Name = $"{prefix}{data.Profile.FirstName} {data.Profile.LastName}",
|
2023-09-26 15:09:01 +07:00
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
2023-10-06 10:04:10 +07:00
|
|
|
|
#region 24
|
2023-09-27 00:01:36 +07:00
|
|
|
|
public async Task<dynamic> GetData4Transfer(Guid id)
|
|
|
|
|
|
{
|
|
|
|
|
|
var data = await _dbContext.Set<PlacementTransfer>().AsQueryable()
|
|
|
|
|
|
.Include(x => x.Profile)
|
|
|
|
|
|
.Where(x => x.Id == id)
|
|
|
|
|
|
.FirstOrDefaultAsync();
|
2023-10-06 10:04:10 +07:00
|
|
|
|
|
|
|
|
|
|
var profile = await _dbContext.Set<Profile>().AsQueryable()
|
|
|
|
|
|
.Include(x => x.Prefix)
|
|
|
|
|
|
.Where(x => x.Id == data.Profile.Id).FirstOrDefaultAsync();
|
|
|
|
|
|
|
|
|
|
|
|
var prefix = string.IsNullOrEmpty(profile.Prefix.Name) ? string.Empty : profile.Prefix.Name;
|
2023-09-27 00:01:36 +07:00
|
|
|
|
return new
|
|
|
|
|
|
{
|
2023-10-06 10:04:10 +07:00
|
|
|
|
CurrentDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM")).ToThaiFullDate().ToString().ToThaiNumber().Remove(0, 15),
|
2023-09-27 00:01:36 +07:00
|
|
|
|
Subject = $"ข้าราชการกรุงเทพมหานครสามัญขอโอน",
|
|
|
|
|
|
Subject2 = $"ตรวจสอบหนี้สิน และภาระผูกพันกับกรุงเทพมหานครของข้าราชการ",
|
|
|
|
|
|
Subject3 = $"ตรวจสอบหนี้สินและภาระผูกพันของข้าราชการ",
|
|
|
|
|
|
Location = $"สำนักงานคณะกรรมการข้าราชการกรุงเทพมหานคร 173 ถนนดินสอ กทม. 10200",
|
2023-10-06 10:04:10 +07:00
|
|
|
|
Name = $"{prefix}{data.Profile.FirstName} {data.Profile.LastName}",
|
2023-09-27 00:01:36 +07:00
|
|
|
|
Position = $"{data.Profile.Position}",
|
|
|
|
|
|
OrganizationOrganization = $"{data.Profile.OrganizationOrganization}",
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
2023-10-06 10:04:10 +07:00
|
|
|
|
#region 25
|
2023-09-27 00:01:36 +07:00
|
|
|
|
public async Task<dynamic> GetData5Transfer(Guid id)
|
|
|
|
|
|
{
|
|
|
|
|
|
var data = await _dbContext.Set<PlacementTransfer>().AsQueryable()
|
|
|
|
|
|
.Include(x => x.Profile)
|
|
|
|
|
|
.Where(x => x.Id == id)
|
|
|
|
|
|
.FirstOrDefaultAsync();
|
2023-10-06 10:04:10 +07:00
|
|
|
|
|
|
|
|
|
|
var profile = await _dbContext.Set<Profile>().AsQueryable()
|
|
|
|
|
|
.Include(x => x.Prefix)
|
|
|
|
|
|
.Where(x => x.Id == data.Profile.Id).FirstOrDefaultAsync();
|
|
|
|
|
|
|
|
|
|
|
|
var prefix = string.IsNullOrEmpty(profile.Prefix.Name) ? string.Empty : profile.Prefix.Name;
|
2023-09-27 00:01:36 +07:00
|
|
|
|
return new
|
|
|
|
|
|
{
|
2023-10-06 10:04:10 +07:00
|
|
|
|
CurrentDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM")).ToThaiFullDate().ToString().ToThaiNumber().Remove(0, 15),
|
2023-09-27 00:01:36 +07:00
|
|
|
|
Subject = $"ข้าราชการกรุงเทพมหานครสามัญขอโอน",
|
|
|
|
|
|
Subject2 = $"ตรวจสอบพฤติการณ์ทางวินัย และภาระหนี้สิน (เงินกู้สวัสดิการข้าราชการ) ของข้าราชการ",
|
|
|
|
|
|
Subject3 = $"ตรวจสอบภาระผูกพันกับกรุงเทพมหานครเกี่ยวกับการลาศึกษา อบรม ของข้าราชการ",
|
|
|
|
|
|
Location = $"สำนักงานคณะกรรมการข้าราชการกรุงเทพมหานคร 173 ถนนดินสอ กทม. 10200",
|
2023-10-06 10:04:10 +07:00
|
|
|
|
Name = $"{prefix}{data.Profile.FirstName} {data.Profile.LastName}",
|
2023-09-27 00:01:36 +07:00
|
|
|
|
Position = $"{data.Profile.Position}",
|
|
|
|
|
|
OrganizationOrganization = $"{data.Profile.OrganizationOrganization}",
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
2023-10-06 10:04:10 +07:00
|
|
|
|
#region 26
|
2023-09-27 00:01:36 +07:00
|
|
|
|
public async Task<dynamic> GetData6Transfer(Guid id)
|
|
|
|
|
|
{
|
|
|
|
|
|
var data = await _dbContext.Set<PlacementTransfer>().AsQueryable()
|
|
|
|
|
|
.Include(x => x.Profile)
|
|
|
|
|
|
.Where(x => x.Id == id)
|
|
|
|
|
|
.FirstOrDefaultAsync();
|
2023-10-06 10:04:10 +07:00
|
|
|
|
|
|
|
|
|
|
var profile = await _dbContext.Set<Profile>().AsQueryable()
|
|
|
|
|
|
.Include(x => x.Prefix)
|
|
|
|
|
|
.Where(x => x.Id == data.Profile.Id).FirstOrDefaultAsync();
|
|
|
|
|
|
|
|
|
|
|
|
var prefix = string.IsNullOrEmpty(profile.Prefix.Name) ? string.Empty : profile.Prefix.Name;
|
2023-09-27 00:01:36 +07:00
|
|
|
|
return new
|
|
|
|
|
|
{
|
2023-10-06 10:04:10 +07:00
|
|
|
|
CurrentDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM")).ToThaiFullDate().ToString().ToThaiNumber().Remove(0, 15),
|
2023-09-27 00:01:36 +07:00
|
|
|
|
Subject = $"ข้าราชการกรุงเทพมหานครสามัญขอโอน",
|
|
|
|
|
|
Subject2 = $"ตรวจสอบพฤติการณ์ทางวินัย และภาระหนี้สิน (เงินกู้สวัสดิการข้าราชการ) ของข้าราชการ",
|
|
|
|
|
|
Subject3 = $"ตรวจสอบภาระผูกพันกับกรุงเทพมหานครเกี่ยวกับการลาศึกษา อบรม ของข้าราชการ",
|
|
|
|
|
|
Subject4 = $"ตรวจสอบหนี้สิน และภาระผูกพันกับกรุงเทพมหานครของข้าราชการ",
|
|
|
|
|
|
Subject5 = $"ตรวจสอบหนี้สินและภาระผูกพันของข้าราชการ",
|
|
|
|
|
|
Location = $"สำนักงานคณะกรรมการข้าราชการกรุงเทพมหานคร 173 ถนนดินสอ กทม. 10200",
|
2023-10-06 10:04:10 +07:00
|
|
|
|
Name = $"{prefix}{data.Profile.FirstName} {data.Profile.LastName}",
|
2023-09-27 00:01:36 +07:00
|
|
|
|
Position = $"{data.Profile.Position}",
|
|
|
|
|
|
OrganizationOrganization = $"{data.Profile.OrganizationOrganization}",
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
2023-09-26 15:09:01 +07:00
|
|
|
|
#endregion
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|