Example #1
0
        public ActionResult GetMenuNodeList()
        {
            string       fucId    = Request.Params[0].Trim();
            string       userId   = HttpContext.Session["User"].ToString();
            MenuNodeList nodeList = new MenuNodeList(userId);
            MenuNode     root     = nodeList.GetCurrentRootNode(fucId);

            IList <MenuNodeDTO> result = new List <MenuNodeDTO>();

            foreach (MenuNode child in root.Children)
            {
                MenuNodeDTO dto = new MenuNodeDTO();
                dto.id   = child.ID;
                dto.text = child.Name;
                dto.url  = child.Url;
                dto.leaf = true;
                if (child.Children.Count > 0)
                {
                    dto.leaf       = false;
                    dto.childNodes = new List <MenuNodeDTO>();
                    AddToRoot(child, dto.childNodes);
                }

                result.Add(dto);
            }

            return(this.Json(result));
        }
Example #2
0
        public ActionResult GetMenuRootList()
        {
            string       userId   = HttpContext.Session["User"].ToString();
            MenuNodeList nodeList = new MenuNodeList(userId);
            IList        list     = nodeList.GetMenuNodeList();

            IList <MenuRootDTO> result = new List <MenuRootDTO>();

            foreach (MenuNode root in list)
            {
                MenuRootDTO dto = new MenuRootDTO();
                dto.id         = root.ID;
                dto.title      = root.Name;
                dto.border     = false;
                dto.autoScroll = true;
                dto.iconCls    = "";
                dto.html       = "";

                result.Add(dto);
            }

            return(this.Json(result));
        }
Example #3
0
        public ActionResult GetMenuRootList()
        {
            string userId = HttpContext.Session["User"].ToString();
            MenuNodeList nodeList = new MenuNodeList(userId);
            IList list = nodeList.GetMenuNodeList();

            IList<MenuRootDTO> result = new List<MenuRootDTO>();
            foreach (MenuNode root in list)
            {
                MenuRootDTO dto = new MenuRootDTO();
                dto.id = root.ID;
                dto.title = root.Name;
                dto.border = false;
                dto.autoScroll = true;
                dto.iconCls = "";
                dto.html = "";

                result.Add(dto);
            }

            return this.Json(result);
        }
Example #4
0
        public ActionResult GetMenuNodeList()
        {
            string fucId = Request.Params[0].Trim();
            string userId = HttpContext.Session["User"].ToString();
            MenuNodeList nodeList = new MenuNodeList(userId);
            MenuNode root = nodeList.GetCurrentRootNode(fucId);

            IList<MenuNodeDTO> result = new List<MenuNodeDTO>();
            foreach (MenuNode child in root.Children)
            {
                MenuNodeDTO dto = new MenuNodeDTO();
                dto.id = child.ID;
                dto.text = child.Name;
                dto.url = child.Url;
                dto.leaf = true;
                if (child.Children.Count > 0)
                {
                    dto.leaf = false;
                    dto.childNodes = new List<MenuNodeDTO>();
                    AddToRoot(child, dto.childNodes);
                }

                result.Add(dto);
            }

            return this.Json(result);
        }