Exemplo n.º 1
0
        // GET: Professor/Enrollments/ViewEvaluations
        public async Task <ActionResult> ViewEvaluations(int?enrollmentId)
        {
            if (!enrollmentId.HasValue)
            {
                return(HttpNotFound());
            }

            var enrollmentWithEvaluations = await _evaluationRepository.GetWithEvaluations(enrollmentId.Value);

            if (enrollmentWithEvaluations.Enrollment == null)
            {
                return(HttpNotFound());
            }

            var viewModel = new EnrollmentWithEvaluationsViewModel(enrollmentWithEvaluations);

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

            AddBreadcrumb("Offerings (Terms)", Url.Action("Index"));
            AddBreadcrumb("Offerings (List)", Url.Action("ViewOfferings", new { TermId = viewModel.Enrollment.Offering.TermId }));
            AddBreadcrumb("Enrollments", Url.Action("ViewEnrollments", new { offeringId = viewModel.Enrollment.OfferingId }));
            AddBreadcrumb("Evaluations", "");

            return(View(viewModel));
        }