protected void RenderSearchProducts() { var handlers = SearchHandlerManager.GetAllHandlersEx(); SearchProducts = handlers .Select(sh => sh.ProductID) .Distinct() .Select(productID => WebItemManager.Instance[productID]) .Where(product => product != null && !product.IsDisabled()); }
private List <SearchResult> SearchByModules(Guid productID, string _searchText) { var searchResults = new List <SearchResult>(); if (String.IsNullOrEmpty(_searchText)) { return(searchResults); } var handlers = productID.Equals(Guid.Empty) ? SearchHandlerManager.GetAllHandlersEx() : SearchHandlerManager.GetHandlersExForCertainProduct(productID); foreach (var sh in handlers) { var module = WebItemManager.Instance[sh.ModuleID]; if (module != null && module.IsDisabled()) { continue; } var items = sh.Search(_searchText); if (items.Length == 0) { continue; } var searchResult = new SearchResult { ModuleID = sh.ModuleID, ProductID = sh.ProductID, PresentationControl = (ItemSearchControl)sh.Control }; BuildName(searchResult, sh, module); BuildLogo(searchResult, sh, module); BuildMoreUrl(searchResult, sh, ref productID); searchResult.PresentationControl.Text = _searchText; searchResult.PresentationControl.MaxCount = 7; searchResult.Items.AddRange(items); searchResults.Add(searchResult); } return(searchResults); }