Ejemplo n.º 1
0
        public ActionResult Create(CourseOfferingDetailsViewModel model)
        {
            var courseOffering = Mapper.Map <CourseOfferingViewModel, CourseOffering>(model);

            _courseOfferingService.CreateCourseOffering(courseOffering);
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
        public ActionResult Create()
        {
            var model = new CourseOfferingDetailsViewModel
            {
                Courses     = _courseService.GetCourses(c => c.IsActive).ToSelectListItems(c => c.Title, c => c.Id.ToString()),
                Rooms       = _roomService.GetAllRooms().ToSelectListItems(r => r.Name, r => r.Id.ToString()),
                Instructors = _instructorService.GetActiveInstructors().ToSelectListItems(i => i.FullName, i => i.Id.ToString()),
            };

            return(View(model));
        }