/// <summary> /// 获取角色 /// </summary> /// <returns></returns> public string GetRoles() { StringBuilder sb = new StringBuilder(); //string[] userRoles = UserData.Roles; //int maxRole = userRoles.Min(); List <Roles> listMenu = new RolesBLL().GetList().ToList(); sb.Append("["); LoopRole(listMenu, listMenu.FindAll(p => p.ParentId == 0 || p.ParentId == null), sb); sb.Append("]"); return(sb.ToString()); }