コード例 #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);
        }
コード例 #2
0
        /// <summary>
        /// 获取 pnr编号 对应的pnr信息.
        /// </summary>
        /// <param name="pnrno">pnr编号.</param>
        /// <returns>pnr信息解析存储,若对应pnr编号无相应信息或已经删除则返回null</returns>
        public ASyncResult retrieve(string pnrno)
        {
            __pnr = pnrno;
            RTResult Result = base.GetSyncResult(string.Format(@"RT:{0}", pnrno)) as RTResult;

            Result.PnrCode = pnrno;
            return(Result);
        }
コード例 #3
0
ファイル: RTCommand.cs プロジェクト: cuitsl/asyncsdk
 /// <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;
 }