Esempio n. 1
0
        /// <summary>
        /// 指令结果解析适配器.
        /// </summary>
        /// <param name="Msg">指令结果集合.</param>
        /// <returns></returns>
        protected override ASyncResult ResultAdapter(string Msg)
        {
            PNRInfo  PnrInfoResult = new AnalysisPRN(__pnr, Msg).ParsePNR();
            RTResult Rt            = new RTResult()
            {
                getAirSegs = new List <PNRAirSegResult>(), getPassengers = new List <PNRPassengerResult>()
            };

            foreach (Passenger p in PnrInfoResult.PassengerList)
            {
                Rt.getPassengers.Add(new PNRPassengerResult()
                {
                    getName    = p.FullName,
                    IdentityNo = p.DocumentNo
                });
            }
            foreach (Segment seg in PnrInfoResult.SegmentList)
            {
                Rt.getAirSegs.Add(new PNRAirSegResult()
                {
                    getAirNo         = string.Format(@"{0}{1}", seg.Airline, seg.FltNo),
                    getDepartureTime = ConvertUtil.InitialsDateCast(string.Format(@"{1} {0}", seg.DepartureTime.Insert(2, ":"), seg.Date)),
                    getArrivalTime   = ConvertUtil.InitialsDateCast(string.Format(@"{1} {0}", seg.ArrivalTime.Insert(2, ":"), seg.Date)),
                    getOrgCity       = seg.DepartureAirport,
                    getDesCity       = seg.ArrivalAirport,
                    getActionCode    = seg.Ticket,
                    getFltClass      = seg.Carbin,
                });
            }
            Rt.IsCancel = PnrInfoResult.Cancel;
            Rt.TKTL     = PnrInfoResult.TKTL;
            //PnrInfoResult.
            return(Rt);
        }
Esempio n. 2
0
 /// <summary>
 /// 指令结果解析适配器.
 /// </summary>
 /// <param name="Msg">指令结果集合.</param>
 /// <returns></returns>
 protected override ASyncResult ResultAdapter(string Msg)
 {
     PNRInfo PnrInfoResult= new AnalysisPRN(__pnr, Msg).ParsePNR();
     RTResult Rt = new RTResult() { getAirSegs=new List<PNRAirSegResult>(), getPassengers=new List<PNRPassengerResult>() };
     foreach (Passenger p in PnrInfoResult.PassengerList) {
         Rt.getPassengers.Add(new PNRPassengerResult() {
          getName=p.FullName,
           IdentityNo=p.DocumentNo
         });
     }
     foreach (Segment seg in PnrInfoResult.SegmentList) {
         Rt.getAirSegs.Add(new PNRAirSegResult() {
          getAirNo=string.Format(@"{0}{1}",seg.Airline,seg.FltNo),
           getDepartureTime=ConvertUtil.InitialsDateCast( string.Format(@"{1} {0}",seg.DepartureTime.Insert(2,":"),seg.Date)),
          getArrivalTime = ConvertUtil.InitialsDateCast(string.Format(@"{1} {0}", seg.ArrivalTime.Insert(2,":"), seg.Date)),
              getOrgCity=seg.DepartureAirport,
               getDesCity=seg.ArrivalAirport,
                getActionCode=seg.Ticket,
                 getFltClass=seg.Carbin,
         });
     }
     Rt.IsCancel = PnrInfoResult.Cancel;
     Rt.TKTL = PnrInfoResult.TKTL;
     //PnrInfoResult.
     return Rt;
 }