Ejemplo n.º 1
0
        // GET: Course/Edit/5
        public ActionResult Edit(long id)
        {
            IDataAccess <Course> dataAccess = new CourseEFDataAccess();
            CourseHandler        handler    = new CourseHandler(dataAccess);
            CourseEditModel      vm         = handler.QueryById(id);

            return(View(vm));
        }
Ejemplo n.º 2
0
        public ActionResult Delete(long id)
        {
            IDataAccess <Course> dataAccess = new CourseEFDataAccess();
            CourseHandler        handler    = new CourseHandler(dataAccess);

            handler.Delete(id);

            return(RedirectToAction("Index"));
        }
Ejemplo n.º 3
0
        // GET: Course
        public ActionResult Index()
        {
            IDataAccess <Course> dataAccess = new CourseEFDataAccess();

            CourseHandler          handler = new CourseHandler(dataAccess);
            List <CourseViewModel> models  = handler.List();

            return(View(models));
        }
Ejemplo n.º 4
0
        public ActionResult Edit(CourseEditModel vm)
        {
            try
            {
                IDataAccess <Course> dataAccess = new CourseEFDataAccess();
                CourseHandler        handler    = new CourseHandler(dataAccess);
                handler.Update(vm);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }