private void BindData() { Category category = CategoryManager.GetCategoryByID(this.CategoryID); if (category != null) { this.txtName.Text = category.Name; this.txtDescription.Value = category.Description; this.txtSmallDescription.Value = category.SmallDescription; CommonHelper.SelectListItem(this.ddlTemplate, category.TemplateID); ParentCategory.SelectedCategoryId = category.ParentCategoryID; Picture categoryPicture = category.Picture; this.btnRemoveCategoryImage.Visible = categoryPicture != null; string pictureUrl = PictureManager.GetPictureUrl(categoryPicture, 100); this.iCategoryPicture.Visible = true; this.iCategoryPicture.ImageUrl = pictureUrl; this.txtPriceRanges.Text = category.PriceRanges; this.cbPublished.Checked = category.Published; this.txtDisplayOrder.Value = category.DisplayOrder; this.ParentCategory.BindData(); } else { this.btnRemoveCategoryImage.Visible = false; this.iCategoryPicture.Visible = false; ParentCategory.SelectedCategoryId = this.ParentCategoryID; ParentCategory.BindData(); } }
protected void FillDropDowns() { ParentCategory.EmptyItemText = GetLocaleResourceString("Admin.Common.All"); ParentCategory.BindData(); this.ddlManufacturer.Items.Clear(); ListItem itemEmptyManufacturer = new ListItem(GetLocaleResourceString("Admin.Common.All"), "0"); this.ddlManufacturer.Items.Add(itemEmptyManufacturer); var manufacturers = this.ManufacturerService.GetAllManufacturers(); foreach (Manufacturer manufacturer in manufacturers) { ListItem item2 = new ListItem(manufacturer.Name, manufacturer.ManufacturerId.ToString()); this.ddlManufacturer.Items.Add(item2); } }
private void BindData() { var category = this.CategoryService.GetCategoryById(this.CategoryId); if (this.HasLocalizableContent) { var languages = this.GetLocalizableLanguagesSupported(); rptrLanguageTabs.DataSource = languages; rptrLanguageTabs.DataBind(); rptrLanguageDivs.DataSource = languages; rptrLanguageDivs.DataBind(); } if (category != null) { this.txtName.Text = category.Name; this.txtDescription.Value = category.Description; CommonHelper.SelectListItem(this.ddlTemplate, category.TemplateId); ParentCategory.SelectedCategoryId = category.ParentCategoryId; Picture categoryPicture = category.Picture; this.btnRemoveCategoryImage.Visible = categoryPicture != null; string pictureUrl = this.PictureService.GetPictureUrl(categoryPicture, 100); this.iCategoryPicture.Visible = true; this.iCategoryPicture.ImageUrl = pictureUrl; this.txtPriceRanges.Text = category.PriceRanges; this.cbShowOnHomePage.Checked = category.ShowOnHomePage; this.cbPublished.Checked = category.Published; this.txtDisplayOrder.Value = category.DisplayOrder; this.ParentCategory.BindData(); } else { this.btnRemoveCategoryImage.Visible = false; this.iCategoryPicture.Visible = false; ParentCategory.SelectedCategoryId = this.ParentCategoryId; ParentCategory.BindData(); } }