예제 #1
0
 public static WeekYearDto MapDto(WorkingWeek ww)
 {
     return new WeekYearDto
     {
         Week = ww.WeekNumber,
         Year = ww.Year.YearNumber
     };
 }
예제 #2
0
 public static WorkWeekDto MapWorkWeekDto(WorkingWeek workweek)
 {
     return new WorkWeekDto
     {
         WorkWeekId = workweek.ID,
         WeekYear = WeekYearDto.MapDto(workweek),
         WorkDays = workweek.WorkingDays.Select(WorkDayDto.MapDto).ToList(),
         CanBeChanged = YearWeekHelp.WeekDaysCanBeChanged(workweek)
     };
 }
예제 #3
0
 public static bool WeekDaysCanBeChanged(WorkingWeek workweek)
 {
     WeekYearDto curDto = new WeekYearDto
     {
         Week = CurrentWeek(),
         Year = DateTime.Now.Year
     };
     WeekYearDto nextDto = GetNextWeekYear(curDto);
     return (workweek.WeekNumber == curDto.Week && workweek.Year.YearNumber == curDto.Year) ||
            (workweek.WeekNumber == nextDto.Week && workweek.Year.YearNumber == nextDto.Year);
 }