private void ToggleAssetTypeFilters() { // Get the asset type var assetType = AssetType.Get(AssetTypeDropDownList1.SelectedId); MetadataFilters.ToggleAssetTypeFilters(assetType); }
protected void SearchButton_Click(object sender, EventArgs e) { // Get base finder AssetFinder finder = SearchManager.GetBaseAssetFinder(CurrentUser); // Reset the category list if all brands are selected, or if the brand selector has changed if (BrandDropDownList1.SelectedId == 0 || finder.BrandId != BrandDropDownList1.SelectedId) { finder.CategoryIdList.Clear(); SavedUserAssetSearch.CurrentCategoryId = -1; } // Set basic criteria finder.GeneralKeyword = KeywordsTextBox.Text.Trim(); finder.BrandId = BrandDropDownList1.SelectedId; finder.AssetTypeId = AssetTypeDropDownList1.SelectedId; MetadataFilters.AddAdvancedSearchCriteria(ref finder); AddCategorySearchCriteria(); // Log the search AuditAssetSearch aas = AuditLogManager.LogSearch(finder, CurrentUser); // Store the finder and clear the audit ID, as we dont want to audit advanced searches SavedUserAssetSearch.AssetFinder = finder; SavedUserAssetSearch.AuditAssetSearchId = aas.AuditAssetSearchId.GetValueOrDefault(); SavedUserAssetSearch.Page = 1; // Redirect to the search results // It will pick up the finder from the session to display results Response.Redirect("~/SearchResults.aspx", false); }
protected void BrandDropDownList1_SelectedIndexChanged(object sender, EventArgs e) { // When the brand dropdown is changed, all of the metadata dropdowns // also need to be updated to display brand specific values MetadataFilters.BrandId = BrandDropDownList1.SelectedId == 0 ? CurrentUser.PrimaryBrandId : BrandDropDownList1.SelectedId; MetadataFilters.LoadFilter(); CategoryId = -1; SetupCategories(); }
private void RebindMetadataFilter() { int brandId = BrandDropDownList1.SelectedId; if (brandId == 0) { brandId = CurrentUser.PrimaryBrandId; } MetadataFilters.BrandId = brandId; MetadataFilters.LoadFilter(); }
public void ToggleSearchVisibility(bool filtersVisible, bool categoriesVisible, bool updateSavedSearch) { if (WebsiteBrandManager.GetBrand().HideFilterSearch) { filtersVisible = false; } if (WebsiteBrandManager.GetBrand().HideCategorySearch) { categoriesVisible = false; } FiltersPanel.Visible = filtersVisible; CategoryNavigationPanel.Visible = categoriesVisible; if (updateSavedSearch) { SavedUserAssetSearch.FilterOpen = filtersVisible; SavedUserAssetSearch.CategoriesOpen = categoriesVisible; } if (categoriesVisible) { // Show the "view all assets" link in the category panel if we have a search keyword // This will allow us to clear the text but retain the category, so that all assets // in the selected category are displayed. ViewAllAssetsLinkButtonWrapper.Visible = (!StringUtils.IsBlank(SavedUserAssetSearch.AssetFinder.GeneralKeyword)); } if (filtersVisible) { // Get the finder from the session var finder = SavedUserAssetSearch.AssetFinder; //load meta lists and dropdowns RebindMetadataFilter(); // load metadata filter MetadataFilters.LoadFilterFromStoredValues(finder); // No need to rebind these // BrandDropDownList1.SafeSelectValue(finder.BrandId); // AssetTypeDropDownList1.SafeSelectValue(finder.AssetTypeId); ToggleAssetTypeFilters(); } TogglePanelButtonText(); }