/// <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); }
/// <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); }
/// <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; }