public virtual ActionResult Create(CreateModel createModel)
        {
            if (!ModelState.IsValid)
                return View(createModel);

            var parentCourse = _createModelToParentCourseMapper.Build(createModel);
            _genericRepository.Add(parentCourse);
            _genericRepository.Save();

            return RedirectToAction(Actions.Index());
        }
예제 #2
0
        public virtual ActionResult Create(CreateModel createModel)
        {
            if (!ModelState.IsValid)
            {
                return(View(createModel));
            }

            var parentCourse = _createModelToParentCourseMapper.Build(createModel);

            _genericRepository.Add(parentCourse);
            _genericRepository.Save();

            return(RedirectToAction(Actions.Index()));
        }
 public void HaveEnteredValidInputForAllFields()
 {
     _createParentCourseModel = new CreateParentCourseModelBuilder().Build();
     _parentCourseIndexPage = _parentCourseCreatePage.CreateParentCourse(_createParentCourseModel);
 }