public ActionResult IndexExecute(int Key) { var service = Container.GetService <IMenuService>(); var info = new MenuInfo() { Key = Key }; if (CanRead) { try { if (Key > 0) { var dto = service.GetMenuDtoByKey(Key); if (dto != null) { ViewBag.Operation = "菜单修改"; info = MenuInfo.ConvertToMenuInfo(dto); return(View(info)); } else { ViewBag.Message = "不存在此菜单,请重新检查"; } } else { ViewBag.Operation = "添加菜单"; return(View(info)); } } catch (Exception ex) { ViewBag.Message = ex.Message; } } else { ViewBag.Message = CannotReadText; } return(View("Error")); }