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