Beispiel #1
0
        private void getToAirportsInfo(Pair location)
        {
            string apiUrl = Config.getAirPortInfoApi + "latitude="
                            + location.First.ToString() + "&longitude=" + location.Second.ToString() + "&apikey=" + Config.amadeuisAppId;


            SendBadHttpRequest.sendHttpRequest(apiUrl, getToAirportsInfoCompleted);
        }
Beispiel #2
0
        public CarRent(String _IATA, DateTime _pickUp, DateTime _dropOff)
        {
            IATA    = _IATA;
            pickUp  = _pickUp;
            dropOff = _dropOff;
            String t1 = pickUp.Year.ToString() + "-" + pickUp.Month.ToString() + "-" + pickUp.Day.ToString();
            String t2 = dropOff.Year.ToString() + "-" + dropOff.Month.ToString() + "-" + dropOff.Day.ToString();

            apiUrl = "http://api.sandbox.amadeus.com/v1.2/cars/search-airport?location=" + IATA + "&pick_up=" + t1 + "&drop_off=" + t2 + "&apikey=" + Config.amadeuisAppId;
            String t = apiUrl;

            SendBadHttpRequest.sendHttpRequest(apiUrl, FindCar);
        }
Beispiel #3
0
        private void getAttractions(double raduis, string attractions)
        {
            string locationApi = "location=" + this.toCity.location.First + "," + this.toCity.location.Second;
            string raduisApi   = "&radius=" + raduis.ToString();
            string typesApi    = "&types=" + attractions; // attractions
            //string minPriceApi = minPrice == PRICE.NONE ? "" : "&minprice=" + ((int)minPrice).ToString();
            //string maxPriceApi = maxPrice == PRICE.NONE ? "" : "&maxprice=" + ((int)maxPrice).ToString();
            string languageApi = "&language=en";
            string appKeyApi   = "&key=" + Config.googleAppId;

            string searcNearbyApi = Config.searchNearByApi + locationApi + raduisApi + typesApi + languageApi + appKeyApi;

            SendBadHttpRequest.sendHttpRequest(searcNearbyApi, getAttractionsRequestCompleted);
        }
Beispiel #4
0
        private void getFlights(Airport fromAirport, Airport toAirPort, string startDate, string returnDate,
                                int adultsNum, int childrenNum, int infantsNum, bool direct, int maxPrice, TRAVEL_CLASS travelClass)
        {
            string originApi        = "origin=" + fromAirport.IATA;
            string dstApi           = "&destination=" + toAirPort.IATA;
            string departureDateApi = "&departure_date=" + startDate;
            string retDateApi       = "&return_date=" + returnDate;
            string adultsApi        = this.adultsNum > 0? "&adults=" + adultsNum.ToString() : "";
            string childrenApi      = this.childrenNum > 0 ? "&children=" + childrenNum.ToString() : "";
            string infantsApi       = this.infantsNum > 0 ? "&infants=" + infantsNum.ToString() : "";
            string directApi        = "&direct=false"; //+ direct.ToString().ToLower();
            string currencyApi      = "&currency=USD";
            string maxPriceApi      = "&max_price=" + maxPrice.ToString();
            string travelClassApi   = "&travel_class=" + travelClass.ToString();
            string resultsNumApi    = "&number_of_results=1";
            string appApiKey        = "&apikey=" + Config.amadeuisAppId;

            string apiUrl = Config.getFlightsApi + originApi + dstApi + departureDateApi + retDateApi + adultsApi + childrenApi
                            + infantsApi + directApi + currencyApi + maxPriceApi + travelClassApi + resultsNumApi + appApiKey;

            SendBadHttpRequest.sendHttpRequest(apiUrl, getFlightsComplete);
        }
Beispiel #5
0
        private void getToPlaceId(string name)
        {
            string apiUrl = Config.getPlaceIdApi + name + "&key=" + Config.googleAppId;

            SendBadHttpRequest.sendHttpRequest(apiUrl, getToPlaceIdCompleted);
        }