Esempio n. 1
0
        public Schedule GenerateNewSchedule()
        {
            //Check to see if a new schedule hasn't been generated today
            if (IsScheduleGeneratedToday())
            {
                return(null);
            }

            var morningShift   = _shiftService.CreateShiftToday(Enums.ShiftType.Morning);
            var afternoonShift = _shiftService.CreateShiftToday(Enums.ShiftType.Afternoon);

            if (morningShift == null || afternoonShift == null)
            {
                return(null);
            }

            //GetAvailableEngineer

            var schedule = new Schedule()
            {
                Date   = new DateTime(DateTime.Now.Day, DateTime.Now.Month, DateTime.Now.Year),
                Shifts = new Tuple <Shift, Shift>(morningShift, afternoonShift)
            };

            return(schedule);
        }