Пример #1
0
        private CourseEntryViewModel GetCourseEntryViewModel()
        {
            var entryViewModel = new CourseEntryViewModel {
                Organizations = _orgManager.GetAllSelectListOrganizations("")
            };

            return(entryViewModel);
        }
Пример #2
0
        public ActionResult Entry(CourseEntryViewModel courseEntryVm)
        {
            if (ModelState.IsValid)
            {
                var course = Mapper.Map <Course>(courseEntryVm);
                course.Tags = _courseManager.GetSelectedTags(courseEntryVm.SelectedTags);

                if (!_courseManager.IsCourseSaved(course))
                {
                    return(RedirectToAction("Error"));
                }

                return(RedirectToAction("Edit", new { id = course.Id }));
            }

            return(RedirectToAction("Error"));
        }