Exemplo n.º 1
0
        public JsonResult getTreeDataPartial(string nodeId)
        {
            var treeData = new UniversalTreeDataSource()
            {
                PartialNodeParent = nodeId
            };

            return(treeData.Serialize(SerializationType.Partial));
        }
Exemplo n.º 2
0
        public JsonResult getTreeData()
        {
            var treeData = new UniversalTreeDataSource()
            {
                LinkFunction = x => Url.Action("Edit", "Pages", new { ID = x })
            };

            return(treeData.Serialize(SerializationType.Pages));
        }
Exemplo n.º 3
0
        public JsonResult getTreeData(string SelectedSection)
        {
            var list = new List <string>();

            if (SelectedSection.IsFilled())
            {
                list.Add(SelectedSection);
            }
            var treeData = new UniversalTreeDataSource()
            {
                CheckedNodes = list
            };

            return(treeData.Serialize(SerializationType.PagesAnsCategories));
        }
Exemplo n.º 4
0
        public JsonResult getTreeDataForPage(string SelectedSection)
        {
            var list = new List <string>();

            if (SelectedSection.IsFilled())
            {
                list.Add(SelectedSection);
            }
            var treeData = new UniversalTreeDataSource()
            {
                CheckedNodes = list, AddCountToCats = false
            };

            return(_getTreeDataForPage ??
                   (_getTreeDataForPage = treeData.Serialize(SerializationType.Pages)));
        }
        public JsonResult getTreeDataCategory(int?category, string selector)
        {
            var list = new List <string>();

            if (category.HasValue)
            {
                var prods =
                    db.StoreCategoryRelations.Where(
                        x => x.BaseCategoryID == category && x.RelatedProductID.HasValue && x.GroupName == selector)
                    .Select(x => "p" + x.RelatedProductID);
                list.AddRange(prods);
            }
            var treeData = new UniversalTreeDataSource()
            {
                CheckedNodes = list
            };

            return(treeData.Serialize(category.HasValue ? SerializationType.FullCatalog : SerializationType.Categories));
        }
        public JsonResult getTreeData(int?product, string selector)
        {
            var list = new List <string>();

            if (product.HasValue)
            {
                var prods =
                    db.StoreProductRelations.Where(
                        x => x.BaseProductID == product && x.BaseProductReverse != null && x.GroupName == selector)
                    .Select(x => "p" + x.RelatedProductID);
                list.AddRange(prods);
            }
            var treeData = new UniversalTreeDataSource()
            {
                CheckedNodes = list
            };

            return(treeData.Serialize(SerializationType.FullCatalog));
        }
Exemplo n.º 7
0
        public JsonResult getTreeData(string SelectedSection, bool?prods, bool isReload = false)
        {
            prods = prods ?? false;
            var list = new List <string>();

            if (SelectedSection.IsFilled())
            {
                list.Add(SelectedSection);
            }
            var treeData = new UniversalTreeDataSource()
            {
                CheckedNodes = list, AddCountToCats = prods.Value
            };

            if (isReload)
            {
                _getTreeDataMenu = treeData.Serialize(SerializationType.PagesAnsCategoriesAndProducts);
            }
            return(_getTreeDataMenu ??
                   (_getTreeDataMenu = treeData.Serialize(SerializationType.PagesAnsCategoriesAndProducts)));
        }