コード例 #1
0
        public async Task <ActionResult> New(ShowOfferingFormViewModel form)
        {
            if (!form.TermId.HasValue)
            {
                return(HttpNotFound());
            }

            var professors = await _professorRepository.GetNotTrashedProfessors();

            var viewModel = new OfferingFormViewModel
            {
                IsNew  = true,
                TermId = form.TermId.Value
            };

            await SetOfferingListProperties(viewModel);

            // Add properties to layout
            AddPageHeader(viewModel.FormTitle, "");

            AddBreadcrumb("Offerings (Terms)", Url.Action("Index"));
            AddBreadcrumb("Offerings (List)", Url.Action("View", new { TermId = form.TermId.Value }));
            AddBreadcrumb(viewModel.FormTitle, "");

            return(View("OfferingForm", viewModel));
        }