Exemple #1
0
        public string GetAllCategorySelect()
        {
            var list     = _homeService.GetAllChildCategoryList(0);
            var treelist = new List <TreeNode>();

            treelist.Add(new TreeNode("0", "", "顶级分类"));

            list.ForEach(l => treelist.Add(new TreeNode(l.CategoryID.ToString(), l.ParentID.ToString(), Tools.FilterAllHtml(l.Name).Replace("\"", ""))));
            var treeHelper = new TreeNodeHelper();
            var tree       = treeHelper.GenerateTreeRoot(treelist);

            return(tree.ToJsonTreeString());
        }