Example #1
0
        public JavaScriptResult Menu()
        {
            List <Privilege> menus       = _SysManageService.GetAllMenu();
            List <string>    usermenuids = _SysManageService.GetUserMenuIds(base.UserId);

            List <Privilege>    topmenus = menus.FindAll(x => string.IsNullOrEmpty(x.ParentID));
            List <JsonTreeNode> list     = BuildTreeNode(menus, topmenus, usermenuids);

            JavaScriptSerializer s  = new JavaScriptSerializer();
            StringBuilder        sb = new StringBuilder();

            s.Serialize(list, sb);
            sb.Insert(0, "var menudata=");
            return(JavaScript(sb.ToString()));
        }