gen หัวกระดาษหนังสือเวียน
This commit is contained in:
parent
ec1da53f59
commit
390eb7296b
1 changed files with 53 additions and 0 deletions
|
|
@ -1,5 +1,6 @@
|
|||
using BMA.EHR.Application.Common.Interfaces;
|
||||
using BMA.EHR.Domain.Extensions;
|
||||
using BMA.EHR.Domain.Models.Organizations;
|
||||
using BMA.EHR.Domain.Models.Retirement;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
|
@ -186,6 +187,58 @@ namespace BMA.EHR.Application.Repositories.Reports
|
|||
}
|
||||
#endregion
|
||||
|
||||
#region หัวกระดาษหนังสือเวียน
|
||||
public async Task<dynamic> GetHeadRetirementDeceasedAsync(Guid id)
|
||||
{
|
||||
var data = await _dbContext.Set<RetirementDeceased>().AsQueryable()
|
||||
.Include(x => x.Profile)
|
||||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
var oc = "";
|
||||
if (data == null)
|
||||
return new
|
||||
{
|
||||
Oc = oc,
|
||||
Number = $"กท /",
|
||||
Date = "",
|
||||
Subject = "ข้าราชการถึงแก่กรรม",
|
||||
Send = "หัวหน้าสำนักงาน ก.ก.",
|
||||
};
|
||||
|
||||
if (data.Profile.OcId != null)
|
||||
{
|
||||
var organization = await _dbContext.Set<OrganizationEntity>().AsQueryable()
|
||||
.Where(x => x.Id == data.Profile.OcId)
|
||||
.FirstOrDefaultAsync();
|
||||
if (organization != null)
|
||||
{
|
||||
var organizationAgency = await _dbContext.Set<OrganizationEntity>().AsQueryable()
|
||||
.Where(x => x.Id == organization.OrganizationAgencyId)
|
||||
.FirstOrDefaultAsync();
|
||||
if (organizationAgency != null)
|
||||
{
|
||||
var agency = await _dbContext.Set<OrganizationEntity>().AsQueryable()
|
||||
.Where(x => x.Id == organizationAgency.Id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (agency != null)
|
||||
{
|
||||
oc = agency.OrganizationOrganization?.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new
|
||||
{
|
||||
Oc = oc,
|
||||
Number = $"กท /{data.CreatedAt.Year.ToThaiYear()}",
|
||||
Date = data.CreatedAt.ToThaiFullDate().ToString().ToThaiNumber(),
|
||||
Subject = "ข้าราชการถึงแก่กรรม",
|
||||
Send = "หัวหน้าสำนักงาน ก.ก.",
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue