Ejemplo n.º 1
0
 public ActionResult Delete(vmCourse course)
 {
     try
     {
         using (CoursesManager)
         {
             var item    = CoursesManager.GetCoursebyID(course.ID);
             var success = CoursesManager.RemoveCourse(item);
             if (success)
             {
                 return(RedirectToAction("Index"));
             }
             throw new DataException();
         }
     }
     catch (DataException)
     {
         ModelState.AddModelError("", "Unable to save changes. Try again, and if the problem persists see your system administrator.");
         return(View(course));
     }
 }