Exemplo n.º 1
0
        public ActionResult Assignment5(CourseListingViewModel viewModel)
        {
            CourseListingDataAccess dataAccess = new CourseListingDataAccess(RavenSession);

            //Populate the dropdowns
            viewModel.Semesters = dataAccess.GetAllSemesters();
            viewModel.Departments = dataAccess.GetAllDepartmentsForCurrentSemester();

            if(!string.IsNullOrEmpty(viewModel.Semester) && !string.IsNullOrEmpty(viewModel.Department))
            {
                viewModel.Courses = dataAccess.GetCoursesBySemesterIDandDepartmentID(viewModel.Semester, viewModel.Department);
            }

            return View("Assignment5", viewModel);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Assignment5s this instance.
        /// </summary>
        /// <returns></returns>
        public ActionResult Assignment5()
        {
            CourseListingDataAccess dataAccess = new CourseListingDataAccess(RavenSession);
            CourseListingViewModel viewModel = new CourseListingViewModel();

            //Populate the dropdowns
            viewModel.Semesters = dataAccess.GetAllSemesters();
            viewModel.Departments = dataAccess.GetAllDepartmentsForCurrentSemester(); //TODO: AJAX populate based off semester

            return View("Assignment5", viewModel);
        }