public void BindTree(int sectionId) { var man = new CategoriesManager(true, true); var filter = new CategoriesFilter(); filter.Enabled = Utility.TristateBool.NotSet; filter.SectionId = (sectionId > 0 ? sectionId : -1); var list = man.GetByFilter(filter, ""); Tree1.Nodes.Clear(); bindTree(list, null); }
private void loadListCategories() { var man = new CategoriesManager(); var filter = new CategoriesFilter(); filter.SectionId = shopSettings.SectionId; var list = man.GetByFilter(filter, ""); ListCategories.Items.Clear(); ListCategories.Items.Add(new ListItem("", "0")); foreach (var item in list) { var listItem = new ListItem(); listItem.Value = item.Id.ToString(); listItem.Text = item.Title; listItem.Enabled = true; ListCategories.Items.Add(listItem); } }
/// <summary> /// parent category /// </summary> public List<Category> Childs(CategoriesManager man) { if (childs == null) { var filter = new CategoriesFilter(); filter.ParentId = this.Id; childs = man.GetByFilter(filter, ""); } return childs; }
private void loadListParentId() { ListParentId.Items.Clear(); //root virtual item var listItem = new ListItem(); listItem.Value = "0"; listItem.Text = ""; listItem.Enabled = true; ListParentId.Items.Add(listItem); var man = new CategoriesManager(true, true); var filter = new CategoriesFilter(); filter.Enabled = Utility.TristateBool.NotSet; if (this.SectionId > 0) filter.SectionId = this.SectionId; else { int secId = -1; int.TryParse(DropSectionsFilter.SelectedValue, out secId); filter.SectionId = secId; } var list = man.GetByFilter(filter, ""); loadListParentId(list, 0, 0, this.CurrentId); }