LV2_015 - รายการขอยกเลิกการลา (ADMIN)
LV2_008 - ขอยกเลิกการลา (USER)
This commit is contained in:
Suphonchai Phoonsawat 2023-12-04 12:10:46 +07:00
parent 1a4d03cdd9
commit 0c2814e53b
13 changed files with 3320 additions and 14 deletions

View file

@ -176,6 +176,24 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
return data;
}
public async Task<List<LeaveRequest>> GetCancelLeaveRequestForAdminAsync(int year, Guid type, string status)
{
var rawData = _dbContext.Set<LeaveRequest>().AsQueryable()
.Include(x => x.Type)
.Where(x => x.LeaveStatus == "DELETE");
if (year != 0)
rawData = (IIncludableQueryable<LeaveRequest, LeaveType>)rawData.Where(x => x.LeaveStartDate.Year == year);
if (type != Guid.Empty)
rawData = (IIncludableQueryable<LeaveRequest, LeaveType>)rawData.Where(x => x.Type.Id == type);
if (status.Trim().ToUpper() != "ALL")
rawData = (IIncludableQueryable<LeaveRequest, LeaveType>)rawData.Where(x => x.LeaveCancelStatus == status);
return await rawData.ToListAsync();
}
#endregion
}
}