Пример #1
0
        public RS_FlightList S_DomesticRoundTripFlight(string _dCity, string _aCity, DateTime _dDate, DateTime _aDate)
        {
            RS_FlightList fl = new RS_FlightList();
            RoundWayFlight flight2 = new RoundWayFlight(_dCity, _aCity, _dDate.ToString("yyyy-MM-dd"), _aDate.ToString("yyyy-MM-dd"));
            if (!flight2.hasFlight())
                return fl;

            fl = flight2.getFlightInfo();
            FlightResponseList frl = flightHelper.SearchDmstRoundTripFlight(_dCity, _aCity, _dDate, _aDate);

            for (int i = 0; i < fl.RouteList.Count; i++)
            {
                RS_FlightRoute route = fl.RouteList[i];
                foreach(FlightResponseData frd in frl.flightResponses[0].flightResponseDatas)
                {
                    RS_FlightDetail fd = route.DetailList[0];
                    if(fd.FlightNum == frd.flight)
                        this.ReplaceFlightDetail(fd, frd);
                }
                foreach (FlightResponseData frd in frl.flightResponses[1].flightResponseDatas)
                {
                    RS_FlightDetail fd = route.DetailList[1];
                    if (fd.FlightNum == frd.flight)
                        this.ReplaceFlightDetail(fd, frd);
                }
            }

            return fl;
        }
Пример #2
0
        //查找国内单程机票
        public RS_FlightList S_DomesticOneWayFlight(string _dCity, string _aCity, DateTime _dDate)
        {
            RS_FlightList fl = new RS_FlightList();
            OneWayFlight flight1 = new OneWayFlight(_dCity, _aCity, _dDate.ToString("yyyy-MM-dd"));
            if (!flight1.hasFlight())
                return fl;

            fl = flight1.getFlightInfo();

            FlightResponseList frl = flightHelper.SearchDmstOneWayFlight(_dCity, _aCity, _dDate);

            foreach (FlightResponseData frd in frl.flightResponses[0].flightResponseDatas)
            {
                bool notExist = true;
                for (int i = 0; i < fl.RouteList.Count; i++)
                {
                    RS_FlightDetail dfd = fl.RouteList[i].DetailList[0];
                    if (dfd.FlightNum == frd.flight)
                    {
                        this.ReplaceFlightDetail(dfd, frd);
                        notExist = false;
                    }
                }
                if (notExist)
                {
                    RS_FlightDetail dfd = new RS_FlightDetail();
                    this.ReplaceFlightDetail(dfd, frd);
                }
            }
            return fl;
        }