Ejemplo n.º 1
0
        /// <summary>
        /// Applies the filters applicable to this given model.
        /// </summary>
        /// <param name="query">The query.</param>
        /// <returns></returns>
        protected override ITypeSearch <FindProduct> ApplyFilters(ITypeSearch <FindProduct> query)
        {
            if (ProductBrands != null && ProductBrands.Any())
            {
                query = query.Filter(x => GetBrandFilter(ProductBrands));
            }

            //if (category != null && category.Any())
            //    query = query.Filter(x => GetWineTypeFilter(category));

            if (CountryList != null && CountryList.Any())
            {
                query = query.Filter(x => GetCountryFilter(CountryList));
            }

            return(query);
        }
Ejemplo n.º 2
0
 private IEnumerable <SelectListItem> SetCountriesSelectList()
 {
     if (CountryList.Any())
     {
         var countrySelectList = new List <SelectListItem>();
         foreach (var c in CountryList)
         {
             var country = new SelectListItem
             {
                 Value = c.IsoAlpha2,
                 Text  = c.CountryNameEnglish
             };
             countrySelectList.Add(country);
         }
         return(countrySelectList);
     }
     return(null);
 }