Пример #1
0
        public List <AirDetails> CompareCurrentPrice(string origin, string destination, List <AirSegmentDetails> segments, int adult, int child, int infant, int senior = 0, int pwd = 0, bool isdirect = true)
        {
            ReValidateItineraryData _req = new ReValidateItineraryData();

            _req.Origin      = origin;
            _req.Destination = destination;
            _req.Adult       = adult;
            _req.Child       = child;
            _req.Infant      = infant;
            _req.Senior      = senior;
            _req.Pwd         = pwd;
            _req.isMulti     = false;
            _req.segments    = segments;

            string postStr           = "=" + JsonConvert.SerializeObject(_req).ToString();
            CustomServiceRequest svc = new CustomServiceRequest(postStr);
            string            json   = GetResponse(JsonConvert.SerializeObject(svc.ComparePriceInformation()));
            List <AirDetails> result = new List <AirDetails>();

            if (!json.Contains("NOFLIGHT"))
            {
                result = JsonConvert.DeserializeObject <List <AirDetails> >(json);
            }
            return(result);
        }
Пример #2
0
        public List <AirDetails> SearchMultiCityFlights(List <MultiFlightSegment> _segments, int adult, int child, int infant, int senior = 0, int pwd = 0, bool isdirect = true)
        {
            MultiCityData _req = new MultiCityData();

            _req.Adult       = adult;
            _req.Child       = child;
            _req.Infant      = infant;
            _req.Senior      = senior;
            _req.Pwd         = pwd;
            _req.Origin      = _segments[0].Origin;
            _req.Destination = _segments[0].Destination;
            _req.CabinClass  = _segments[0].Class;
            _req.segments    = _segments;
            _req.isDirect    = isdirect;

            string postStr           = "=" + JsonConvert.SerializeObject(_req).ToString();
            CustomServiceRequest svc = new CustomServiceRequest(postStr);
            string            json   = GetResponse(svc.LowFareSearchMC());
            List <AirDetails> result = new List <AirDetails>();

            if (!json.Contains("NOFLIGHT"))
            {
                result = JsonConvert.DeserializeObject <List <AirDetails> >(json);
            }
            return(result);
        }
Пример #3
0
        public string AddRemark(string recordLocator, string receivedFrom, string command)
        {
            CustomServiceRequest svc = new CustomServiceRequest(recordLocator, receivedFrom, command, 1);
            string json   = GetResponse(JsonConvert.SerializeObject(svc.AddRemarkInformation()));
            string result = json;

            return(result);
        }
Пример #4
0
        public string CancelPNR(string recordLocator, string receivedFrom)
        {
            CustomServiceRequest svc = new CustomServiceRequest(recordLocator, false, receivedFrom);
            string json   = GetResponse(JsonConvert.SerializeObject(svc.CancelReservation()));
            string result = json;

            return(result);
        }
Пример #5
0
        public string SabreCommand(string command)
        {
            CustomServiceRequest svc = new CustomServiceRequest(command);
            string json   = GetResponse(JsonConvert.SerializeObject(svc.SendCommandInformation()));
            string result = json;

            MessageBox.Show(result);
            return(result);
        }
Пример #6
0
        public List <AirDetails> SearchOneWayFlights(string origin, string destination, string departure, int adult, int child, int infant, int senior = 0, int pwd = 0, bool isdirect = true, string cabin = "Economy")
        {
            CustomServiceRequest sv  = new CustomServiceRequest(origin, destination, adult, child, infant, senior, pwd, cabin, departure, isdirect);
            string            json   = GetResponse(sv.LowFareSearchOW());
            List <AirDetails> result = new List <AirDetails>();

            if (!json.Contains("NOFLIGHT"))
            {
                result = JsonConvert.DeserializeObject <List <AirDetails> >(json);
            }
            return(result);
        }
Пример #7
0
        public FareRule GetFareRule(string farebasis, string cabin, string carrier, string origin, string destination)
        {
            CustomServiceRequest sv = new CustomServiceRequest(farebasis, cabin, origin, destination, carrier);
            string   json           = GetResponse(sv.GetFareRuleInformation());
            FareRule result         = new FareRule();

            if (!json.Contains("ERROR"))
            {
                result = JsonConvert.DeserializeObject <FareRule>(json);
            }
            return(result);
        }
Пример #8
0
        public string AddDocumentPassport(string recordLocator, List <AirSegmentDetails> segments, List <PassengerName> passengers)
        {
            ModifySpecialServiceData _req = new ModifySpecialServiceData();

            _req.names         = passengers;
            _req.segments      = segments;
            _req.RecordLocator = recordLocator;
            string postStr = "=" + JsonConvert.SerializeObject(_req).ToString();

            CustomServiceRequest svc = new CustomServiceRequest(postStr);
            string json   = GetResponse(JsonConvert.SerializeObject(svc.GetModifyDocumentInformation()));
            string result = json;

            return(result);
        }
Пример #9
0
        public string CreatePNR(List <AirSegmentDetails> segments, List <PassengerName> passengers, List <PassengerContact> contacts, double totalAmount, string origin, string destination, string validatingCarrier, string requesterPaxTitle, string requesterFirstName, string requesterLastName, string email, string currency = "PHP", int createdBy = 0)
        {
            try
            {
                CreatePassengerNameRecordData _req = new CreatePassengerNameRecordData();

                _req.names    = passengers;
                _req.contacts = contacts;
                _req.segments = segments;
                _req.isMulti  = false;

                AgencyProfile ag = new AgencyProfile();

                // change this part if B2B
                ag.AgencyName              = "BCD PHILSCAN TRAVEL";                           //required put the name of agency. Max of 50 Chars. Special chars not allowed like & ( ) #  % * ^
                ag.City                    = "MAKATI CITY";                                   //required to put the address city of agency. Max of 20 Chars. Special chars not allowed like & ( ) #  % * ^
                ag.PostalCode              = "1231";                                          //required to put the postal code.
                ag.Address                 = "2F ROYAL ENTERPRISE BLDG 2227 CHINO ROCES AVE"; //required to put the address. Max of 50 Chars. MSpecial chars not allowed like & ( ) #  % * ^
                _req.AgencyAddressLine     = ag.AgencyName;
                _req.AgencyCityName        = ag.City;
                _req.AgencyCountryCode     = "PH";
                _req.AgencyPostalCode      = ag.PostalCode;
                _req.AgencyStreetNmbr      = ag.Address;
                _req.TicketingDeadline     = "7TAW";
                _req.SpecialRequestRemarks = "";

                _req.PaxTitle              = requesterPaxTitle;  //Request Title. Optional, for database record only.
                _req.FirstName             = requesterFirstName; //Requester First Name. Optional, for database record only.
                _req.LastName              = requesterLastName;  //Requester Last Name. Optional, for database record only.
                _req.Email                 = email;              //Requester Email or Email of the First Passenger. Required.
                _req.Origin                = origin;             //Search Origin. Required.
                _req.Destination           = destination;        //Search Destination. Required.
                _req.Curr                  = currency;           //Booking Currency. Required.
                _req.TotalAmountBeforeBook = totalAmount;        //initial total amount before PNR creation. Optional, for database record only.
                _req.PricingCarrier        = validatingCarrier;  //Validating or the Pricing Carrier. Required.
                _req.CreatedBy             = createdBy;          //change this to EmpID if B2B. Optional, for database record only.


                string postStr           = "=" + JsonConvert.SerializeObject(_req).ToString();
                CustomServiceRequest svc = new CustomServiceRequest(postStr);
                string reloc             = GetResponse(JsonConvert.SerializeObject(svc.CreateReservation()));
                return(reloc);
            }
            catch (Exception e)
            {
                return("FAILED - " + e.GetBaseException().ToString());
            }
        }
Пример #10
0
        public PnrMain RetrievePNR(string recordLocator)
        {
            PnrMain result = new PnrMain();

            try
            {
                CustomServiceRequest svc = new CustomServiceRequest(recordLocator, false);
                string json = GetResponse(JsonConvert.SerializeObject(svc.RetrieveReservation()));
                if (!json.Contains("ERROR"))
                {
                    result = JsonConvert.DeserializeObject <PnrMain>(json);
                }
            }
            catch (Exception x)
            {
                string errs = x.GetBaseException().ToString();
            }
            return(result);
        }