เพิ่มคิวรี่ subject ที่คำสั่ง
This commit is contained in:
parent
c9d0800461
commit
785d8b4f6b
3 changed files with 25 additions and 20 deletions
|
|
@ -63,7 +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"))
|
||||
.Where(x => (x.Profile.ProfileType == "EMPLOYEE" && x.Profile.EmployeeClass == "PREM") || (x.Profile.ProfileType == "OFFICER"))
|
||||
.OrderByDescending(x => x.CreatedAt)
|
||||
.Select(p => new
|
||||
{
|
||||
|
|
@ -124,7 +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.Profile.ProfileType == "EMPLOYEE" && x.Profile.EmployeeClass == "PREM") || (x.Profile.ProfileType == "OFFICER"))
|
||||
.Where(x => x.Id == id)
|
||||
.Select(p => new
|
||||
{
|
||||
|
|
@ -244,7 +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"))
|
||||
.Where(x => (x.ProfileType == "EMPLOYEE" && x.EmployeeClass == "PREM") || (x.ProfileType == "OFFICER"))
|
||||
.FirstOrDefaultAsync(x => x.Id == req.Id);
|
||||
if (profile == null)
|
||||
return Error(GlobalMessages.DataNotFound, 404);
|
||||
|
|
@ -326,7 +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"))
|
||||
.Where(x => (x.Profile.ProfileType == "EMPLOYEE" && x.Profile.EmployeeClass == "PREM") || (x.Profile.ProfileType == "OFFICER"))
|
||||
.FirstOrDefaultAsync(x => x.Id == id);
|
||||
if (uppdated == null)
|
||||
return Error(GlobalMessages.PlacementAppointmentNotFound, 404);
|
||||
|
|
@ -406,7 +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"))
|
||||
.Where(x => (x.Profile.ProfileType == "EMPLOYEE" && x.Profile.EmployeeClass == "PREM") || (x.Profile.ProfileType == "OFFICER"))
|
||||
.FirstOrDefaultAsync(x => x.Id == id);
|
||||
if (uppdated == null)
|
||||
return Error(GlobalMessages.PlacementAppointmentNotFound, 404);
|
||||
|
|
@ -489,7 +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"))
|
||||
.Where(x => (x.Profile.ProfileType == "EMPLOYEE" && x.Profile.EmployeeClass == "PREM") || (x.Profile.ProfileType == "OFFICER"))
|
||||
.FirstOrDefaultAsync(x => x.Id == id);
|
||||
if (deleted == null)
|
||||
return NotFound();
|
||||
|
|
@ -526,7 +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"))
|
||||
.Where(x => (x.Profile.ProfileType == "EMPLOYEE" && x.Profile.EmployeeClass == "PREM") || (x.Profile.ProfileType == "OFFICER"))
|
||||
.FirstOrDefaultAsync(x => x.Id == item);
|
||||
if (uppdated == null)
|
||||
continue;
|
||||
|
|
@ -556,6 +556,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
{
|
||||
var appointments = await _context.PlacementAppointments
|
||||
.Where(x => x.PositionNumber != null)
|
||||
.Where(x => (x.Profile.ProfileType == "EMPLOYEE" && x.Profile.EmployeeClass == "PREM") || (x.Profile.ProfileType == "OFFICER"))
|
||||
.Select(x => x.PositionNumber.Id)
|
||||
.ToListAsync();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue