add
LV2_015 - รายการขอยกเลิกการลา (ADMIN) LV2_008 - ขอยกเลิกการลา (USER)
This commit is contained in:
parent
1a4d03cdd9
commit
0c2814e53b
13 changed files with 3320 additions and 14 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue