Ejemplo n.º 1
0
        /// <summary>
        /// 菜单树
        /// </summary>
        /// <returns></returns>
        public ActionResult FindTreeList()
        {
            int count = 0;
            var list  = ProductCategoryService.FindPageList(Request.Params, out count, false);

            list.Each(o =>
            {
                o.Childrens.Each(i =>
                {
                    i.OnOff = i.Childrens != null && i.Childrens.Any() ? "closed" : "open";
                });
            });
            var trees = new List <ProductCategory>()
            {
                new ProductCategory()
                {
                    Id        = 0,
                    Title     = "商品分类",
                    OnOff     = "open",
                    Childrens = new List <ProductCategory>()
                }
            };

            trees[0].Childrens.AddRange(list);
            return(new JsonNetResult(trees));
        }
Ejemplo n.º 2
0
        public ActionResult FindPageList()
        {
            int count = 0;
            var ls    = ProductCategoryService.FindPageList(Request.Params, out count);

            return(ToDataGrid(ls, ls.Count));
        }