//获取二级节点 public List <SecondModuleMenu> GetSencondMenuByModuleId(string roleId, string ModuleId) { List <SecondModuleMenu> SendModuleMenu = new List <SecondModuleMenu>(); try { //按钮列表 List <TSModule> tsModule = tsModuleDBO.GetTSModuleButton(roleId, ModuleId); for (int j = 0; j < tsModule.Count; j++) { SecondModuleMenu sencondMenu = new SecondModuleMenu() { ModuleCode = tsModule[j].moduleCode, ModuleId = tsModule[j].moduleId, ModuleName = tsModule[j].moduleName, }; SendModuleMenu.Add(sencondMenu); } } catch (Exception ex) { throw new Exception(ex.Message); } return(SendModuleMenu); }
private void GetModuleInfo(TSUser tsUser) { try { List <FirstModuleMenu> firstList = rightMenu.GetFirstMenuByModuleId(tsUser.roleIds); if (firstList != null && firstList.Count > 0) { for (int i = 0; i < firstList.Count; i++) { FirstModuleMenu info = firstList[i]; if (info != null) { List <SecondModuleMenu> sencondlist = rightMenu.GetSencondMenuByModuleId(tsUser.roleIds, info.ModuleId); if (sencondlist != null && sencondlist.Count > 0) { for (int j = 0; j < sencondlist.Count; j++) { SecondModuleMenu sendModuleMenu = sencondlist[j]; if (sendModuleMenu != null) { List <Controls> controlList = rightMenu.GetButtonListByModuleId(tsUser.roleIds, sendModuleMenu.ModuleId); sendModuleMenu.ControlsList = controlList; } } } info.SendModuleMenuList = sencondlist; } } tsUser.FirstModule = firstList; } } catch (Exception ex) { throw new Exception(ex.Message); } }
public PermissionDescriptionAttribute(SecondModuleMenu menu, string funcName, bool isMenu = false) { this.FuncName = funcName; this.ParentMenu = menu; this.IsMenu = isMenu; }