Example #1
0
        // GET: Professor/Enrollments/ViewEnrollments
        public async Task <ActionResult> ViewEnrollments(int?offeringId)
        {
            if (!offeringId.HasValue)
            {
                return(HttpNotFound());
            }

            var offering = await _offeringRepository.GetOfferingById(offeringId.Value);

            if (offering == null)
            {
                return(HttpNotFound());
            }

            var enrollments = await _enrollmentRepository.GetEnrollmentsByOfferingId(offeringId.Value);

            // Add properties to layout
            AddPageHeader("Enrollments", "");

            AddBreadcrumb("Offerings (Terms)", Url.Action("Index"));
            AddBreadcrumb("Offerings (List)", Url.Action("ViewOfferings", new { TermId = offering.TermId }));
            AddBreadcrumb("Enrollments", "");

            return(View(
                       new EnrollmentListViewModel
            {
                Offering = offering,
                Enrollments = enrollments
            }));
        }