public ActionResult CreateAction(FormCollection collection) { if (!AccessActions.IsAccess("RoleAction::Write")) { System.Web.Routing.RouteValueDictionary route = new System.Web.Routing.RouteValueDictionary(); route.Add("err", "Нет доступа!"); return(RedirectToAction("Error", "User", route)); } try { ActionModel theAction = new ActionModel(); theAction.Name = collection["Name"]; theAction.Description = collection["Description"]; theAction.Create(); return(RedirectToAction("IndexActions")); } catch (Exception ex) { ViewBag.Error = ex.Message; return(RedirectToAction("IndexActions")); } }