api แต่งตั้งลูกจ้าง
This commit is contained in:
parent
15054de97f
commit
4b9c3a2bc7
7 changed files with 576 additions and 0 deletions
|
|
@ -63,6 +63,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
{
|
||||
|
||||
var placementAppointments = await _context.PlacementAppointments.AsQueryable()
|
||||
.Where(x => (x.Profile.ProfileType == "EMPLOYEE" && x.Profile.EmployeeType == "PREM") || (x.Profile.ProfileType == "OFFICER"))
|
||||
.OrderByDescending(x => x.CreatedAt)
|
||||
.Select(p => new
|
||||
{
|
||||
|
|
@ -123,6 +124,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
public async Task<ActionResult<ResponseObject>> GetDetailByUser(Guid id)
|
||||
{
|
||||
var data = await _context.PlacementAppointments.AsQueryable()
|
||||
.Where(x => (x.Profile.ProfileType == "EMPLOYEE" && x.Profile.EmployeeType == "PREM") || (x.Profile.ProfileType == "OFFICER"))
|
||||
.Where(x => x.Id == id)
|
||||
.Select(p => new
|
||||
{
|
||||
|
|
@ -242,6 +244,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
.Include(x => x.Position)
|
||||
.Include(x => x.Gender)
|
||||
.Include(x => x.Prefix)
|
||||
.Where(x => (x.ProfileType == "EMPLOYEE" && x.EmployeeType == "PREM") || (x.ProfileType == "OFFICER"))
|
||||
.FirstOrDefaultAsync(x => x.Id == req.Id);
|
||||
if (profile == null)
|
||||
return Error(GlobalMessages.DataNotFound, 404);
|
||||
|
|
@ -323,6 +326,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
public async Task<ActionResult<ResponseObject>> UpdatePositionPlacementAppointment([FromBody] PersonSelectPositionAppointmentRequest req, Guid id)
|
||||
{
|
||||
var uppdated = await _context.PlacementAppointments
|
||||
.Where(x => (x.Profile.ProfileType == "EMPLOYEE" && x.Profile.EmployeeType == "PREM") || (x.Profile.ProfileType == "OFFICER"))
|
||||
.FirstOrDefaultAsync(x => x.Id == id);
|
||||
if (uppdated == null)
|
||||
return Error(GlobalMessages.PlacementAppointmentNotFound, 404);
|
||||
|
|
@ -402,6 +406,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
public async Task<ActionResult<ResponseObject>> Put([FromBody] PlacementAppointmentEditRequest req, Guid id)
|
||||
{
|
||||
var uppdated = await _context.PlacementAppointments
|
||||
.Where(x => (x.Profile.ProfileType == "EMPLOYEE" && x.Profile.EmployeeType == "PREM") || (x.Profile.ProfileType == "OFFICER"))
|
||||
.FirstOrDefaultAsync(x => x.Id == id);
|
||||
if (uppdated == null)
|
||||
return Error(GlobalMessages.PlacementAppointmentNotFound, 404);
|
||||
|
|
@ -484,6 +489,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
var deleted = await _context.PlacementAppointments.AsQueryable()
|
||||
.Include(x => x.PlacementAppointmentDocs)
|
||||
.ThenInclude(x => x.Document)
|
||||
.Where(x => (x.Profile.ProfileType == "EMPLOYEE" && x.Profile.EmployeeType == "PREM") || (x.Profile.ProfileType == "OFFICER"))
|
||||
.FirstOrDefaultAsync(x => x.Id == id);
|
||||
if (deleted == null)
|
||||
return NotFound();
|
||||
|
|
@ -520,6 +526,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
foreach (var item in req.Id)
|
||||
{
|
||||
var uppdated = await _context.PlacementAppointments
|
||||
.Where(x => (x.Profile.ProfileType == "EMPLOYEE" && x.Profile.EmployeeType == "PREM") || (x.Profile.ProfileType == "OFFICER"))
|
||||
.FirstOrDefaultAsync(x => x.Id == item);
|
||||
if (uppdated == null)
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue