public JsonResult DeleteMenu(string key) { MenuInfo info = new MenuInfo(); if (!string.IsNullOrEmpty(key)) { info.Id = key; OperationResult opr = MenuService.Remove(key); return Json(new JsonResultHelper(opr.Message)); } else { return Json(new JsonResultHelper(false, "选择的记录无效", "")); } }
public JsonResult UpdateMenuValid(string key, string validstatus) { MenuInfo info = new MenuInfo(); if (!string.IsNullOrEmpty(key) && !string.IsNullOrEmpty(validstatus)) { info.Id = key; info.SYS_IsValid = int.Parse(validstatus); OperationResult opr = MenuService.Modify(info); return Json(new JsonResultHelper(opr.Message)); } else { return Json(new JsonResultHelper(false, "选择的记录无效", "")); } }
public ViewResult MenuForm(string key) { ViewBag.Title = "MenuForm"; ViewBag.DicMenu = PublicMethod.ListAllMenuInfo(MenuService, key); ViewBag.DicApp = PublicMethod.ListAllAppInfo(AppService, null); if (string.IsNullOrEmpty(key)) { MenuInfo info = new MenuInfo(); return View(info); } else { MenuInfo info = MenuService.Load(key); return View(info); } }
public ActionResult SaveMenu(MenuInfo info) { OperationResult opr = new OperationResult(OperationResultType.Success); try { if (string.IsNullOrEmpty(info.Id)) { info.Id = System.Guid.NewGuid().ToString(); opr = MenuService.Create(info); } else { opr = MenuService.Modify(info); } ViewBag.DicMenu = PublicMethod.ListAllMenuInfo(MenuService, info.Id); ViewBag.DicApp = PublicMethod.ListAllAppInfo(AppService, null); ViewBag.PromptMsg = opr.Message; } catch (Exception err) { ViewBag.PromptMsg = err.Message; } return View("MenuForm", info); }
public static void MenuETD(Menu entity, MenuInfo info) { info.Id = entity.Id; info._IdIsDirty = 0; info.ParentId = entity.ParentId; info._ParentIdIsDirty = 0; info.MenuCode = entity.MenuCode; info._MenuCodeIsDirty = 0; info.MenuName = entity.MenuName; info._MenuNameIsDirty = 0; info.MenuIcon = entity.MenuIcon; info._MenuIconIsDirty = 0; info.MenuPath = entity.MenuPath; info._MenuPathIsDirty = 0; info.AppId = entity.AppId; info._AppIdIsDirty = 0; info.IsLeaf = entity.IsLeaf; info._IsLeafIsDirty = 0; info.TreeNode = entity.TreeNode; info._TreeNodeIsDirty = 0; info.SYS_OrderSeq = entity.SYS_OrderSeq; info._SYS_OrderSeqIsDirty = 0; info.SYS_IsValid = entity.SYS_IsValid; info._SYS_IsValidIsDirty = 0; info.SYS_IsDeleted = entity.SYS_IsDeleted; info._SYS_IsDeletedIsDirty = 0; info.SYS_Remark = entity.SYS_Remark; info._SYS_RemarkIsDirty = 0; info.SYS_StaffId = entity.SYS_StaffId; info._SYS_StaffIdIsDirty = 0; info.SYS_StationId = entity.SYS_StationId; info._SYS_StationIdIsDirty = 0; info.SYS_DepartmentId = entity.SYS_DepartmentId; info._SYS_DepartmentIdIsDirty = 0; info.SYS_CompanyId = entity.SYS_CompanyId; info._SYS_CompanyIdIsDirty = 0; info.SYS_AppId = entity.SYS_AppId; info._SYS_AppIdIsDirty = 0; info.SYS_CreateTime = entity.SYS_CreateTime; info._SYS_CreateTimeIsDirty = 0; info.SYS_ModifyTime = entity.SYS_ModifyTime; info._SYS_ModifyTimeIsDirty = 0; info.SYS_DeleteTime = entity.SYS_DeleteTime; info._SYS_DeleteTimeIsDirty = 0; }