add API จัดการปฏิทินวันหยุด ขรก
This commit is contained in:
parent
0e22e3886f
commit
77410d9fa3
4 changed files with 81 additions and 10 deletions
|
|
@ -1,7 +1,3 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using BMA.EHR.Application.Common.Interfaces;
|
||||
using BMA.EHR.Application.Messaging;
|
||||
using BMA.EHR.Domain.Models.Leave.TimeAttendants;
|
||||
|
|
@ -11,7 +7,7 @@ using Microsoft.Extensions.Configuration;
|
|||
|
||||
namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
|
||||
{
|
||||
public class UserCalendarRepository : GenericLeaveRepository<Guid, UserDutyTime>
|
||||
public class UserCalendarRepository : GenericLeaveRepository<Guid, UserCalendar>
|
||||
{
|
||||
#region " Fields "
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ namespace BMA.EHR.Application.Repositories.MetaData
|
|||
return data;
|
||||
}
|
||||
|
||||
public int GetWeekEndCount(DateTime startDate, DateTime endDate)
|
||||
public int GetWeekEndCount(DateTime startDate, DateTime endDate, string category = "NORMAL")
|
||||
{
|
||||
var dates = new List<DateTime>();
|
||||
|
||||
|
|
@ -45,7 +45,11 @@ namespace BMA.EHR.Application.Repositories.MetaData
|
|||
dates.Add(i);
|
||||
}
|
||||
|
||||
var count = dates.Where(d => d.DayOfWeek == DayOfWeek.Saturday || d.DayOfWeek == DayOfWeek.Sunday).Count();
|
||||
var count = 0;
|
||||
if (category == "NORMAL")
|
||||
count = dates.Where(d => d.DayOfWeek == DayOfWeek.Saturday || d.DayOfWeek == DayOfWeek.Sunday).Count();
|
||||
else
|
||||
count = dates.Where(d => d.DayOfWeek == DayOfWeek.Sunday).Count();
|
||||
|
||||
return count;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue