Beispiel #1
0
 public static WeekYearDto MapDto(WorkingWeek ww)
 {
     return new WeekYearDto
     {
         Week = ww.WeekNumber,
         Year = ww.Year.YearNumber
     };
 }
Beispiel #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)
     };
 }
Beispiel #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);
 }