// // GET: /Branch/Delete/5 public ActionResult Delete(int id) { if (!Access.HasAccess(10)) { System.Web.Routing.RouteValueDictionary route = new System.Web.Routing.RouteValueDictionary(); route.Add("err", "Нет доступа!"); return(RedirectToAction("Error", "Home", route)); } Branche theBranche = new Branche(); theBranche = theBranche.GetById(id); theBranche.Delete(theBranche); return(RedirectToAction("Index")); }