api รายงานขอโอน
This commit is contained in:
parent
59f782e8cf
commit
83dba4373b
8 changed files with 166 additions and 23 deletions
|
|
@ -0,0 +1,76 @@
|
|||
using System;
|
||||
using System.Reflection.Metadata;
|
||||
using System.Text.RegularExpressions;
|
||||
using BMA.EHR.Application.Common.Interfaces;
|
||||
using BMA.EHR.Application.Responses;
|
||||
using BMA.EHR.Domain.Extensions;
|
||||
using BMA.EHR.Domain.Models.HR;
|
||||
using BMA.EHR.Domain.Models.Organizations;
|
||||
using BMA.EHR.Domain.Models.Placement;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
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 "
|
||||
|
||||
#region 2
|
||||
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 currentdate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).ToThaiFullDate().ToString().ToThaiNumber().Remove(0, 16);
|
||||
return new
|
||||
{
|
||||
CurrentDate = currentdate,
|
||||
Subject = $"ข้าราชการกรุงเทพมหานครสามัญขอโอน",
|
||||
Name = $"{data.Profile.Prefix?.Name}{data.Profile.FirstName} {data.Profile.LastName}",
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 3
|
||||
public async Task<dynamic> GetData3Transfer(Guid id)
|
||||
{
|
||||
var data = await _dbContext.Set<PlacementTransfer>().AsQueryable()
|
||||
.Include(x => x.Profile)
|
||||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
var currentdate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).ToThaiFullDate().ToString().ToThaiNumber().Remove(0, 16);
|
||||
return new
|
||||
{
|
||||
CurrentDate = currentdate,
|
||||
Subject = $"ข้าราชการขอโอน",
|
||||
Name = $"{data.Profile.Prefix?.Name}{data.Profile.FirstName} {data.Profile.LastName}",
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue