public ActionResult Index(int roleId = -1) { ViewBag.CurrentRoleId = roleId; SysRoleLogic roleLogic = new SysRoleLogic(); List <SysRole> roleList = roleLogic.GetRoleList().ToList <SysRole>(); ViewBag.RoleId = new SelectList(roleList, "RoleId", "RoleName"); List <SysRoleRight> roleRightList = new List <SysRoleRight>(); if (roleId > 0) { SysModuleLogic moduleLogic = new SysModuleLogic(); List <SysModule> moduleList = moduleLogic.GetModuleList().ToList <SysModule>(); ViewBag.ModuleList = moduleList; SysMenuLogic menuLogic = new SysMenuLogic(); List <SysMenu> menuList = menuLogic.GetMenuList(0).ToList <SysMenu>(); ViewBag.MenuList = menuList; roleRightList = logic.GetRoleRightList(roleId, false).ToList <SysRoleRight>(); } return(View(roleRightList)); }
public ActionResult Menu() { SysModuleLogic moduleLogic = new SysModuleLogic(); SysMenuLogic menuLogic = new SysMenuLogic(); List <SysModule> moduleList = moduleLogic.GetModuleList(0).ToList <SysModule>(); List <SysMenu> menuList = menuLogic.GetUserMenuList(this.WorkContext.CurrentUser.UserId).ToList <SysMenu>(); ViewBag.ModuleList = moduleList ?? new List <SysModule>(); ViewBag.MenuList = menuList ?? new List <SysMenu>(); return(View()); }