private void PopulateManufacturers() { ManufacturerFilter.DataSource = HccApp.ContactServices.Manufacturers.FindAll(); ManufacturerFilter.DataTextField = "DisplayName"; ManufacturerFilter.DataValueField = "Bvin"; ManufacturerFilter.DataBind(); ManufacturerFilter.Items.Insert(0, new ListItem("- Any Manufacturer -", string.Empty)); }
protected void Page_Init(object sender, EventArgs e) { //INITIALIZE VARIABLES _CategoryId = AbleCommerce.Code.PageHelper.GetCategoryId(); _Category = CategoryDataSource.Load(_CategoryId); _ProductId = AlwaysConvert.ToInt(Request.QueryString["ProductId"]); _Product = ProductDataSource.Load(_ProductId); if (_Product == null) { Response.Redirect(AbleCommerce.Code.NavigationHelper.GetAdminUrl("Catalog/Browse.aspx?CategoryId=" + _CategoryId.ToString())); } _KitComponentId = AlwaysConvert.ToInt(Request.QueryString["KitComponentId"]); _KitComponent = KitComponentDataSource.Load(_KitComponentId); if (_KitComponent == null) { Response.Redirect("EditKit.aspx?CategoryId=" + _CategoryId.ToString() + "&ProductId=" + _ProductId.ToString()); } CancelLink.NavigateUrl += "?CategoryId=" + _CategoryId.ToString() + "&ProductId=" + _ProductId.ToString(); Caption.Text = string.Format(Caption.Text, _KitComponent.Name); InstructionText.Text = string.Format(InstructionText.Text, _KitComponent.Name, _Product.Name); int categoryCount = CategoryDataSource.CountAll(); StoreSettingsManager settings = AbleContext.Current.Store.Settings; _DisplayCategorySearch = settings.CategorySearchDisplayLimit > 0 && categoryCount >= settings.CategorySearchDisplayLimit; // INITIALIZE DROP DOWN LISTS if (!_DisplayCategorySearch) { InitializeCategoryTree(); } else { // DISPLAY AUTO COMPLETE FOR CATEGORY SEARCH OPTION string js = PageHelper.GetAutoCompleteScript(Page.ResolveClientUrl("~/CategorySuggest.ashx"), CategoryAutoComplete, HiddenSelectedCategoryId, "Key", "Value"); ScriptManager.RegisterStartupScript(PageAjax, this.GetType(), "CATEGORY_SUGGEST", js, true); CategoryAutoComplete.Visible = true; CategoryFilter.Visible = false; } ManufacturerFilter.DataSource = ManufacturerDataSource.LoadAll("Name"); ManufacturerFilter.DataBind(); VendorFilter.DataSource = VendorDataSource.LoadAll("Name"); VendorFilter.DataBind(); // LOAD CUSTOM VIEWSTATE VARIABLES LoadCustomViewState(); if (_SelectedProducts.Count > 0) { // REBIND THE REPEATER BindSelectedProducts(_SelectedProducts); } AbleCommerce.Code.PageHelper.SetDefaultButton(NameFilter, SearchButton.ClientID); AbleCommerce.Code.PageHelper.SetDefaultButton(SkuFilter, SearchButton.ClientID); }