Beispiel #1
0
        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);
        }