Пример #1
0
        public ActionResult SearchCourses(string search)
        {
            ActionResult result = null;

            EnrollmentViewModel enrollModel = new EnrollmentViewModel
            {
                Courses = _db.SearchCourses(search),
                Users   = _db.GetAllUsers()
            };

            if (IsStudent)
            {
                result = View("_Enrollment", enrollModel);
            }
            else // not logged in or not student
            {
                result = RedirectToAction("NotAuth", "Home");
            }

            return(result);
        }
Пример #2
0
        public ActionResult _Enrollment()
        {
            ActionResult result = null;

            EnrollmentViewModel enrollModel = new EnrollmentViewModel
            {
                //gets all courses
                Courses = _db.GetCourses(),
                Users   = _db.GetAllUsers()
            };

            if (IsStudent)
            {
                result = View("_Enrollment", enrollModel);
            }
            else // not logged in or not student
            {
                result = RedirectToAction("NotAuth", "Home");
            }

            return(result);
        }