//设置国外往返机票搜索信息 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; }
//设置国外单程机票搜索信息 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; }