public IHttpActionResult SearchByPrice(PriceSearchRequestDto dto) { ISearchingCriterion <Offer> criterion = OffersSearchingCriteriaFactory.CreatePriceSearchingCriterion(dto.MinimalPrice, dto.MaximalPrice); return(Search(dto.Username, new[] { criterion }, dto.SortType, dto.SortBy)); }
public IList <OfferViewModel> SearchByPrice(IAccommodationContext context, PriceSearchingModel model) { ISearchingCriterion <Offer> criterion = OffersSearchingCriteriaFactory.CreatePriceSearchingCriterion(PriceFromString(model.MinimalPrice), PriceFromString(model.MaximalPrice)); 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)); }
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)); }