Ejemplo n.º 1
0
        //设置国外往返机票搜索信息
        public IntlFlightResponseList SearchIntlRoundTripFlight(String _departCity, String _arriveCity, DateTime _departDate, DateTime _backDate)
        {
            //搜索出发机票
            FlightRoute goRoute = new FlightRoute();
            CityCodeTranslator cct = new CityCodeTranslator();
            goRoute.DepartCity = cct.TranslateToCode(_departCity);
            goRoute.ArriveCity = cct.TranslateToCode(_arriveCity);
            goRoute.DepartDate = _departDate;//出发日期

            IntlRoundFlightSearch irfs = new IntlRoundFlightSearch();
            irfs.AddRoutes(goRoute, _departDate, _backDate);//返程日期
            irfs.SetReturnEntity(apiCallProxy);

            IntlFlightResponse ifr = this.GenerateResultsFromIntl(irfs.returnEntity);

            //搜索返程机票
            irfs.AddRouting(ifr.GetFlightReponseData()[0].Routings);
            irfs.SetShoppingInfoID(ifr.GetFlightReponseData()[0].ShoppingInfoID);
            irfs.SetReturnEntity(apiCallProxy);

            IntlFlightResponse ifr2 = this.GenerateResultsFromIntl(irfs.returnEntity);
            IntlFlightResponseList ifrl = new IntlFlightResponseList();
            ifrl.SetFlightResponse(ifr);
            ifrl.SetFlightResponse(ifr2);
            this.GenerateXmlFileFromIntl(ifrl);

            /*
            IntlFlightResponseList result = new IntlFlightResponseList();
            IntlFlightResponse response = new IntlFlightResponse();
            IntlFlightResponse response2 = new IntlFlightResponse();
            response.SetFlightResponseData(ifr.GetFlightReponseData()[0]);
            response.SetFlightResponseData(ifr2.GetFlightReponseData()[0]);
            result.SetFlightResponse(response);
            result.SetFlightResponse(response2);
             */

            return ifrl;
        }
Ejemplo n.º 2
0
        //设置国内往返机票搜索信息
        public FlightResponseList SearchDmstRoundTripFlight(String _departCity, String _arriveCity, DateTime _departDate, DateTime _backDate)
        {
            FlightRoute goRoute = new FlightRoute();
            CityCodeTranslator cct = new CityCodeTranslator();
            goRoute.DepartCity = cct.TranslateToCode(_departCity);
            goRoute.ArriveCity = cct.TranslateToCode(_arriveCity);
            goRoute.DepartDate = _departDate;//出发日期

            RoundFlightSearch rfs = new RoundFlightSearch(new DateTime(2013, 2, 20));//订票日期
            rfs.AddRoutes(goRoute, _backDate);//返程日期
            rfs.SetReturnEntity(apiCallProxy);
            FlightResponseList frl = this.GenerateResultsFromDmst(rfs.returnEntity);

            /*
            FlightResponseList result = new FlightResponseList();
            FlightResponse response = new FlightResponse();
            FlightResponse response2 = new FlightResponse();
            response.SetFlightResponseData(frl.GetFlightReponse()[0].GetFlightReponseData()[0]);
            result.SetFlightResponse(response);
            response2.SetFlightResponseData(frl.GetFlightReponse()[1].GetFlightReponseData()[0]);
            result.SetFlightResponse(response2);*/

            return frl;
        }
Ejemplo n.º 3
0
        //设置国外单程机票搜索信息
        public IntlFlightResponseList SearchIntlOneWayFlight(String _departCity, String _arriveCity, DateTime _departDate)
        {
            FlightRoute route = new FlightRoute();
            CityCodeTranslator cct = new CityCodeTranslator();
            route.DepartCity = cct.TranslateToCode(_departCity);
            route.ArriveCity = cct.TranslateToCode(_arriveCity);
            route.DepartDate = _departDate;//出发日期

            IntlSingleFlightSearch isfs = new IntlSingleFlightSearch(route);
            isfs.SetReturnEntity(apiCallProxy);

            IntlFlightResponse ifr = this.GenerateResultsFromIntl(isfs.returnEntity);
            IntlFlightResponseList ifrl = new IntlFlightResponseList();
            ifrl.SetFlightResponse(ifr);
            this.GenerateXmlFileFromIntl(ifrl);

            /*
            IntlFlightResponseList result = new IntlFlightResponseList();
            IntlFlightResponse response = new IntlFlightResponse();
            response.SetFlightResponseData(ifr.GetFlightReponseData()[0]);
            result.SetFlightResponse(response);
             */

            return ifrl;
        }
Ejemplo n.º 4
0
        //设置国内单程机票搜索信息 returnEntity
        public FlightResponseList SearchDmstOneWayFlight(String _departCity, String _arriveCity, DateTime _departDate)
        {
            FlightRoute route = new FlightRoute();
            CityCodeTranslator cct = new CityCodeTranslator();
            route.DepartCity = cct.TranslateToCode(_departCity);
            route.ArriveCity = cct.TranslateToCode(_arriveCity);
            route.DepartDate = _departDate;//出发日期

            SingleFlightSearch sfs = new SingleFlightSearch(new DateTime(), route);//订票日期
            sfs.SetReturnEntity(apiCallProxy);
            FlightResponseList frl = this.GenerateResultsFromDmst(sfs.returnEntity);

            /*
            FlightResponseList result = new FlightResponseList();
            FlightResponse response = new FlightResponse();
            response.SetFlightResponseData(frl.GetFlightReponse()[0].GetFlightReponseData()[0]);
            result.SetFlightResponse(response);*/

            return frl;
        }