//
        // POST: /RoleAction/DeleteAction/5

        public ActionResult DeleteAction(int id)
        {
            if (!AccessActions.IsAccess("RoleAction::Write"))
            {
                System.Web.Routing.RouteValueDictionary route = new System.Web.Routing.RouteValueDictionary();
                route.Add("err", "Нет доступа!");
                return(RedirectToAction("Error", "User", route));
            }
            try
            {
                // TODO: Add delete logic here
                ActionModel theAction = new ActionModel();
                theAction.FindByID(id);
                theAction.Delete();
                return(RedirectToAction("IndexActions"));
            }
            catch (Exception ex)
            {
                ViewBag.Error = ex.Message;
                return(View("IndexActions"));
            }
        }