public JsonResult CategoryTree(string checkedOnload)
        {
            List <string> arr = new List <string>();

            if (!string.IsNullOrEmpty(checkedOnload))
            {
                checkedOnload = HttpUtility.UrlDecode(checkedOnload);
                arr           = checkedOnload.ToLower().Split(',').ToList();
            }

            var data = new FeTreeNodeBuilder().GetAllCategoryForSideMenu(false, LanguageId, new List <Enums.CategoryType>()
            {
                Enums.CategoryType.Product, Enums.CategoryType.NewsAndProduct
            }, false);

            foreach (var dt in data)
            {
                if (arr.Contains(dt.id.ToLower()))
                {
                    dt.state = new FeTreeNode.State()
                    {
                        @checked = true, selected = true, opened = true
                    };
                }
            }

            return(Json(data, JsonRequestBehavior.AllowGet));
        }
        public JsonResult EcommerceCategoryTree()
        {
            var data = new FeTreeNodeBuilder().GetAllCategoryForSideMenu(false, LanguageId, new List <Enums.CategoryType>()
            {
                Enums.CategoryType.Product, Enums.CategoryType.NewsAndProduct
            }, true, false);

            return(Json(data, JsonRequestBehavior.AllowGet));
        }
Esempio n. 3
0
        public JsonResult CategoryTree()
        {
            var data = new FeTreeNodeBuilder().GetAllCategoryForSideMenu(null, LanguageId, null, false);

            return(Json(data, JsonRequestBehavior.AllowGet));
        }