public ActionResult Dashboard()
        {
            DateTime start = DateTime.Today,
                     end   = start.AddDays(7);

            var viewModel = new AdvisorIndexViewModel()
            {
                AdvisorTodosList = db.Todoes.Take(5),
                EventAlertList   = db.Events.Where(d => d.StartDate > start && d.StartDate < end),
                NCStudentsList   = db.Students.Where(d => d.Is_Compliant == false)
            };

            return(View(viewModel));
        }
Beispiel #2
0
        public ActionResult Alerts()
        {
            DateTime start = DateTime.Today,
                     end   = start.AddDays(7);

            var viewModel = new AdvisorIndexViewModel()
            {
                //select only non compiant students from db
                NCStudentsList = db.Students.Where(d => d.Is_Compliant == false),
                //select only events within 7 days of current date
                AlertList = db.Events.Where(d => d.StartDate > start && d.StartDate < end)
            };

            return(View(viewModel));
        }