Esempio n. 1
0
        //[MultipleButton(Name = "action", Argument = "Tourico")]
        public List <string> GetHotels(FormCollection collection)
        {
            GeoLocation gloc = new GeoLocation();

            gloc.Latitude  = Convert.ToDecimal(collection["lat"]);
            gloc.Longitude = Convert.ToDecimal(collection["lan"]);

            HotelSearchRequestDto searchCriteria = new HotelSearchRequestDto();

            //holds list of hotel ids to search
            var hotelIds = new List <string>();

            //Retrieve from catalog the list of hotel ids, that will be passed to the provider, if the coordinates are specified in the request
            var catalogRequest = new HotelCatalogRequest
            {
                GeoLocation = gloc,
                MinRating   = HotelBedsConstants.MinRating,
                MaxRating   = HotelBedsConstants.MaxRating,
            };

            //HotelSearchManager call to get the provider and search
            //If "Skip Local Cache" is false, then call the catalog manager for local search -- (!request.SkipLocalCache)
            if (true)
            {
                var hotelCatalogManager = new HotelCatalogManager();
                hotelIds = hotelCatalogManager.RetrieveHotelsByLatLongCatalog(catalogRequest);
            }

            return(hotelIds);
        }
Esempio n. 2
0
 private HotelAvailabilityProviderReq ConvertToHotelSearchReq(HotelSearchRequestDto request, List <string> hotelCode)
 {
     return(new HotelAvailabilityProviderReq
     {
         CheckInDate = request.CheckInDate,
         CheckOutDate = request.CheckOutDate,
         LocationType = TE.Core.ServiceCatalogues.HotelCatalog.Enums.LocationTypes.HotelCode,
         TotalAdults = request.NumberOfAdults,
         GeoLocation = request.Location,
         HotelCodes = hotelCode,
         CurrencyCode = new TCurrency {
             CurrencyCode = request.Currency
         },
         MinRating = request.MinRating,
         MaxRating = request.MaxRating
     });
 }