fix defect
This commit is contained in:
parent
21b8c0450c
commit
fadb544566
6 changed files with 494 additions and 19 deletions
|
|
@ -26,15 +26,30 @@ namespace BMA.EHR.Application.Repositories.MetaData
|
|||
|
||||
#region " Methods "
|
||||
|
||||
public async Task<int> GetHolidayCountAsync(DateTime startDate,DateTime endDate, string category = "NORMAL")
|
||||
public async Task<int> GetHolidayCountAsync(DateTime startDate, DateTime endDate, string category = "NORMAL")
|
||||
{
|
||||
var data = await _dbContext.Set<Holiday>().AsQueryable()
|
||||
.Where(x => x.Category == category)
|
||||
.Where(x => x.HolidayDate.Date >= startDate && x.HolidayDate.Date <= endDate)
|
||||
.CountAsync();
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
public int GetWeekEndCount(DateTime startDate, DateTime endDate)
|
||||
{
|
||||
var dates = new List<DateTime>();
|
||||
|
||||
for (DateTime i = startDate; i < endDate; i = i.AddDays(1))
|
||||
{
|
||||
dates.Add(i);
|
||||
}
|
||||
|
||||
var count = dates.Where(d => d.DayOfWeek == DayOfWeek.Saturday || d.DayOfWeek == DayOfWeek.Sunday).Count();
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue