api บันทึก และ แสดง ข้อมูลผู้สมัคร
This commit is contained in:
parent
ffeab6a127
commit
a781c375d7
40 changed files with 10433 additions and 2 deletions
39
Core/HolidayHelper.cs
Normal file
39
Core/HolidayHelper.cs
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
namespace BMA.EHR.Recurit.Exam.Service.Core
|
||||
{
|
||||
public static class HolidayHelper
|
||||
{
|
||||
public static bool IsHoliday(DateTime date, List<DateTime> holidays)
|
||||
{
|
||||
return holidays.Contains(date);
|
||||
}
|
||||
|
||||
public static bool IsWeekend(DateTime date)
|
||||
{
|
||||
return date.DayOfWeek == DayOfWeek.Saturday
|
||||
|| date.DayOfWeek == DayOfWeek.Sunday;
|
||||
}
|
||||
|
||||
public static bool IsWeekend6Days(DateTime date)
|
||||
{
|
||||
return date.DayOfWeek == DayOfWeek.Sunday;
|
||||
}
|
||||
|
||||
public static DateTime GetNextWorkingDay(DateTime date, List<DateTime> holidays)
|
||||
{
|
||||
do
|
||||
{
|
||||
date = date.AddDays(1);
|
||||
} while (IsHoliday(date, holidays) || IsWeekend(date));
|
||||
return date;
|
||||
}
|
||||
|
||||
public static DateTime GetNextWorkingDay6Days(DateTime date, List<DateTime> holidays)
|
||||
{
|
||||
do
|
||||
{
|
||||
date = date.AddDays(1);
|
||||
} while (IsHoliday(date, holidays) || IsWeekend6Days(date));
|
||||
return date;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue