public IHttpActionResult SearchByPlace(PlaceSearchRequestDto dto)
        {
            ISearchingCriterion <Offer> criterion =
                OffersSearchingCriteriaFactory.CreatePlaceSearchingCriterion(dto.PlaceName, dto.CityName);

            return(Search(dto.Username, new [] { criterion }, dto.SortType, dto.SortBy));
        }
Пример #2
0
        public IList <OfferViewModel> SearchByPlace(IAccommodationContext context, PlaceSearchingModel model)
        {
            ISearchingCriterion <Offer> criterion =
                OffersSearchingCriteriaFactory.CreatePlaceSearchingCriterion(model.PlaceName, model.CityName);

            return(Search(context, model.Username, new[] { criterion }, model.SortType, model.SortBy));
        }
 public IHttpActionResult SearchByMultipleCriteria(AdvancedSearchRequestDto dto)
 {
     ISearchingCriterion <Offer>[] criteria = new[]
     {
         OffersSearchingCriteriaFactory.CreatePlaceSearchingCriterion(dto.PlaceName, dto.CityName),
         OffersSearchingCriteriaFactory.CreateDateSearchingCriterion(dto.MinimalDate, dto.MaximalDate),
         OffersSearchingCriteriaFactory.CreatePriceSearchingCriterion(dto.MinimalPrice, dto.MaximalPrice)
     };
     return(Search(dto.Username, criteria, dto.SortType, dto.SortBy));
 }
Пример #4
0
 public IList <OfferViewModel> SearchByMultipleCriteria(IAccommodationContext context, AdvancedSearchingModel model)
 {
     ISearchingCriterion <Offer>[] criteria = new[]
     {
         OffersSearchingCriteriaFactory.CreatePlaceSearchingCriterion(model.PlaceName, model.CityName),
         OffersSearchingCriteriaFactory.CreateDateSearchingCriterion(model.MinimalDate, model.MaximalDate),
         OffersSearchingCriteriaFactory.CreatePriceSearchingCriterion(PriceFromString(model.MinimalPrice), PriceFromString(model.MaximalPrice))
     };
     return(Search(context, model.Username, criteria, model.SortType, model.SortBy));
 }