Exemple #1
0
        public EmployeeScheduleModel(DateTime startDate, DateTime endDate, List <EmployeeShift> employeeShifts, List <EmployeeConflict> employeeConflicts, List <Shift> shifts, List <Employee> employees)
        {
            StartDate = startDate;
            EndDate   = endDate;

            Shifts            = shifts.Select(s => new ShiftDisplayModel(s)).ToList();
            Employees         = employees.Select(e => new EmployeeDisplayModel(e)).ToList();
            EmployeeShifts    = employeeShifts.Select(es => new EmployeeShiftModel(es)).ToList();
            EmployeeConflicts = employeeConflicts.Select(ec => new EmployeeConflictModel(ec)).ToList();

            Shifts             = Shifts.OrderBy(s => s.PositionCategory).ThenBy(s => s.PositionName).ThenBy(s => s.ShiftStartMinute).ToList();
            PositionCategories = Shifts.Select(s => s.PositionCategory).Distinct().ToList();
        }