private SearchAirLeg CreateLeg(typeSearchLocation originLoc, typeSearchLocation destLoc)
        {
            SearchAirLeg leg = new SearchAirLeg();
            leg.SearchOrigin.SetValue(originLoc.Item, 0);
            leg.SearchDestination.SetValue(destLoc.Item, 0);

            return leg;
        }
Exemplo n.º 2
0
        private SearchAirLeg CreateLeg(typeSearchLocation originLoc, typeSearchLocation destLoc)
        {
            SearchAirLeg leg = new SearchAirLeg();

            leg.SearchOrigin.SetValue(originLoc.Item, 0);
            leg.SearchDestination.SetValue(destLoc.Item, 0);

            return(leg);
        }
        public SearchAirLeg CreateAirLeg(string originAirportCode, string destAirportCode)
        {
            typeSearchLocation originLoc = new typeSearchLocation();
            typeSearchLocation destLoc = new typeSearchLocation();

            // airport objects are just wrappers for their codes
            Airport origin = new Airport(), dest = new Airport();
            origin.Code = originAirportCode;
            dest.Code = destAirportCode;

            // search locations can be things other than airports but we are using
            // the airport version...
            originLoc.Item = origin;
            destLoc.Item = dest;

            return CreateLeg(originLoc, destLoc);
        }
Exemplo n.º 4
0
        public SearchAirLeg CreateAirLeg(string originAirportCode, string destAirportCode)
        {
            typeSearchLocation originLoc = new typeSearchLocation();
            typeSearchLocation destLoc   = new typeSearchLocation();

            // airport objects are just wrappers for their codes
            Airport origin = new Airport(), dest = new Airport();

            origin.Code = originAirportCode;
            dest.Code   = destAirportCode;

            // search locations can be things other than airports but we are using
            // the airport version...
            originLoc.Item = origin;
            destLoc.Item   = dest;

            return(CreateLeg(originLoc, destLoc));
        }
        /**
         * Make a search location based on a city or airport code (city is 
         * preferred to airport in a conflict) and set the search radius to
         * 50mi.
        */
        public static typeSearchLocation CreateLocationNear(String cityOrAirportCode)
        {
            typeSearchLocation result = new typeSearchLocation();

            //city
            CityOrAirport place = new CityOrAirport();
            place.Code = cityOrAirportCode;
            place.PreferCity = true;
            result.Item = place;

            //distance
            Distance dist = new Distance();
            dist.Units = DistanceUnits.MI;
            dist.Value = string.Format("50");
            result.Distance = dist;

            return result;
        }
Exemplo n.º 6
0
        /**
         * Make a search location based on a city or airport code (city is
         * preferred to airport in a conflict) and set the search radius to
         * 50mi.
         */
        public static typeSearchLocation CreateLocationNear(String cityOrAirportCode)
        {
            typeSearchLocation result = new typeSearchLocation();

            //city
            CityOrAirport place = new CityOrAirport();

            place.Code       = cityOrAirportCode;
            place.PreferCity = true;
            result.Item      = place;

            //distance
            Distance dist = new Distance();

            dist.Units      = DistanceUnits.MI;
            dist.Value      = string.Format("50");
            result.Distance = dist;

            return(result);
        }