public void CreateDefaults(CourseSelectionViewModel model)
        {
            DefaultEvents = new List <Event>();

            var sleep = new Event()
            {
                EventTypeId      = 2,
                EventDescription = db.EventTypes.Where(x => x.Id == 2).FirstOrDefault().Description,
                Hours            = 8
            };

            sleep.Weekdays = Array.ConvertAll(sleep.Weekdays, i => true);

            DefaultEvents.Add(sleep);

            if (model.SelectedCourses != null)
            {
                var courseId        = model.SelectedCourses.Where(c => c != 0);
                var courses         = db.Courses.Where(c => courseId.Contains(c.Id)).ToList();
                var totalCourseTime = courses.Select(c => c.CreditHours).ToList().Sum() * 60;
                var dayCounter      = 0;

                foreach (var course in courses)
                {
                    if (dayCounter >= 7)
                    {
                        dayCounter = 0;
                    }
                    var evt = new Event
                    {
                        EventTypeId      = 3,
                        EventDescription = db.EventTypes.Where(x => x.Id == 3).FirstOrDefault().Description + ": " + course.Description,
                        Hours            = course.CreditHours
                    };
                    evt.Weekdays[dayCounter] = true;
                    DefaultEvents.Add(evt);
                    dayCounter++;
                }
            }
        }
        public EventSelectionViewModel(CourseSelectionViewModel model)
        {
            CreateDefaults(model);

            EventTypes = db.EventTypes.ToList();
        }