Exemple #1
0
        //public string getItinerary()
        //{
        //    string allitinerary = "";

        //    try
        //    {

        //        System.Collections.ArrayList itinerary = new System.Collections.ArrayList();

        //        PNR objPNR = new PNR();

        //        //k1aTST.TST objTST = new k1aTST.TST();

        //        int itineraryCount = 1;

        //        objPNR.RetrievePNR(objSession, "rt" + var);

        //        //objTST.RetrieveSpecificTst(objSession, "rt" + var);

        //        int itineraryNum = 0;

        //        foreach (s1aPNR.AirSegment _ItineraryElement in objPNR.AirSegments)
        //        {
        //            //itinerary.Add(decodeALFind(_ItineraryElement.Airline, deCodeAL).Trim() + "   " + _ItineraryElement.FlightNo + "   " + String.Format("{0:dd-MMM}", _ItineraryElement.DepartureDate) + "   " + decodeCityFind(_ItineraryElement.BoardPoint, deCodeCity).Trim() + "/" + decodeCityFind(_ItineraryElement.OffPoint, deCodeCity).Trim() + "   " + ampmTimeConvert(_ItineraryElement.DepartureTime, deCodeTime) + "   " + ampmTimeConvert(_ItineraryElement.ArrivalTime, deCodeTime) + "   " + String.Format("{0:dd-MMM}", _ItineraryElement.ArrivalDate) + "   " + getBaggageAllowance(itineraryNum, showBaggage));
        //            itineraryNum += 1;
        //            itinerary.Add(decodeALFind(_ItineraryElement.Airline, deCodeAL).Trim() + ";" + _ItineraryElement.FlightNo + ";" + String.Format("{0:dd-MMM}", _ItineraryElement.DepartureDate) + ";" + decodeCityFind(_ItineraryElement.BoardPoint, deCodeCity).Trim() + ";" + decodeCityFind(_ItineraryElement.OffPoint, deCodeCity).Trim() + ";" + ampmTimeConvert(_ItineraryElement.DepartureTime, deCodeTime) + ";" + ampmTimeConvert(_ItineraryElement.ArrivalTime, deCodeTime) + ";" + String.Format("{0:dd-MMM}", _ItineraryElement.ArrivalTime) + ";" + ((bool)showClass ? _ItineraryElement.Class : "") + ";" + ((bool)showBaggage ? getBaggageAllowance(itineraryNum) : "") + "");
        //        }

        //        //int ctr = 0;

        //        return itinerary[segNum].ToString();

        //    }
        //    catch (Exception ex)
        //    {
        //        _errorStr = ex.Message;
        //    }

        //    return allitinerary;
        //}

        public string getAirlineLocator(string var, bool decodeAL)
        {
            //string pnrReloc = "";
            string allItinerary = "";
            string newReference = "";

            PNR objPNR = new PNR();

            List <string> pnrsData = new List <string>(var.Split(','));

            System.Collections.ArrayList airSegments = new System.Collections.ArrayList();
            int ctr = 0;

            try
            {
                foreach (string strData in pnrsData)
                {
                    objPNR.RetrievePNR(objSession, "rt" + strData);

                    foreach (s1aPNR.AirSegment obj in objPNR.AirSegments)
                    {
                        string strAirLine = ((obj.AirlineReference == null) ? strData : obj.AirlineReference);
                        airSegments.Add(decodeALFind(obj.Airline, decodeAL) + "- " + strAirLine + "\n");
                    }

                    for (int i = 0; i < (airSegments.Count); i++)
                    {
                        ctr++;

                        if (newReference != airSegments[i].ToString())
                        {
                            allItinerary += airSegments[i] + "";
                            newReference  = airSegments[i].ToString();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                _errorStr = ex.Message;
            }

            return(allItinerary.ToUpper());
        }
Exemple #2
0
        public string getTimeLimit(string var)
        {
            string ticketLimitData    = "";
            string allTicketLimitData = "";

            PNR objPNR = new PNR();

            List <string> pnrsData = new List <string>(var.Split(','));

            try
            {
                foreach (string strData in pnrsData)
                {
                    objPNR.RetrievePNR(objSession, "rt" + strData);

                    foreach (s1aPNR.TicketElement tktl in objPNR.TicketElements)
                    {
                        if (tktl.Text.Contains("TK TL"))
                        {
                            ticketLimitData = tktl.Text.Remove(0, tktl.Text.IndexOf("TK TL") + 5).Trim().Substring(0, 5).Trim();
                        }
                        else if (tktl.Text.Contains("TK OK"))
                        {
                            ticketLimitData = tktl.Text.Remove(0, tktl.Text.IndexOf("TK OK") + 5).Trim().Substring(0, 5).Trim();
                        }

                        allTicketLimitData += strData.ToUpper() + " - " + ticketLimitData + "\n";
                    }
                }
            }
            catch (Exception ex)
            {
                _errorStr = ex.Message;
            }

            return(allTicketLimitData);
        }