public ActionResult Index(FormCollection collection)
        {
            HotelRateDescriptionRS priceBreakup = null;
            HotelSelectDto select = new HotelSelectDto();
            select.StartDate = Request.QueryString["startDate"];
            select.EndDate = Request.QueryString["endDate"];
            select.TotalTravellers = Request.QueryString["totalTravellers"];
            select.HotelCode = Request.QueryString["hotelCode"];
            select.RPHNumber = Request.QueryString["propertyRphNumber"];

            var session = SabreSessionManager.Create();
            select.SessionId = session.SecurityValue.BinarySecurityToken;
            var hotelDesc = new HotelPropertyDescription()
               .HotelDescription(select);

            //Get pricing information
            if (hotelDesc.RoomStay != null && hotelDesc.RoomStay.RoomRates != null)
            {
                HotelPricing pricing = new HotelPricing();
                select.RPHNumber = select.RPHNumber;
                priceBreakup = pricing.GetPricing(select);
            }

            SessionClose closeSession = new SessionClose();
            closeSession.Close(select.SessionId);

            return View(priceBreakup);
        }
Пример #2
0
        public EndTransactionRS Book(HotelSelectDto hotelSelectDto)
        {
            var session = SabreSessionManager.Create();
            hotelSelectDto.SessionId = session.SecurityValue.BinarySecurityToken;

            try
            {
                var hotelDescription = new HotelPropertyDescription()
                    .HotelDescription(hotelSelectDto);

                var addTravelerInfo = new AddTravelerInfo()
                    .AddTraveler(session.SecurityValue.BinarySecurityToken);

                var bookHotel = new BookHotel()
                    .Book(session.SecurityValue.BinarySecurityToken, hotelSelectDto.propertyRphNumber);

                var readTravelerInfo = new ReadTravelerInfo()
                    .ReadInfo(session.SecurityValue.BinarySecurityToken);

                var endTransaction = new EndTransaction().End(session.SecurityValue.BinarySecurityToken);

                return endTransaction;
                //var pnrDetails = new ReadTravelerInfo().ReadInfo(session.SecurityValue.BinarySecurityToken, endTransaction.ItineraryRef.ID);
                //return pnrDetails;
            }
            catch
            {
                throw;
            }
            finally
            {
                SessionClose close = new SessionClose();
                close.Close(session.SecurityValue.BinarySecurityToken);
            }
        }
Пример #3
0
        public TravelItineraryReadRS GetDetails(string pnrIdentifier)
        {
            var session = SabreSessionManager.Create();

            var t = new ReadTravelerInfo().ReadInfo(session.SecurityValue.BinarySecurityToken, pnrIdentifier);

            SessionClose close = new SessionClose();
            close.Close(session.SecurityValue.BinarySecurityToken);

            return t;
        }
Пример #4
0
        public TravelItineraryReadRS GetDetails(string pnrIdentifier)
        {
            var session = SabreSessionManager.Create();

            var t = new ReadTravelerInfo().ReadInfo(session.SecurityValue.BinarySecurityToken, pnrIdentifier);

            SessionClose close = new SessionClose();

            close.Close(session.SecurityValue.BinarySecurityToken);

            return(t);
        }
Пример #5
0
        public HotelResModifyRS Modify(string pnr)
        {
            var session = SabreSessionManager.Create();
            ReadTravelerInfo readInfo = new ReadTravelerInfo();
            var result = readInfo.ReadInfo(session.SecurityValue.BinarySecurityToken, pnr);

            HotelResModifyRQ req = new HotelResModifyRQ();

            HotelResModifyService client = new HotelResModifyService();
            var modifyResult = client.HotelResModifyRQ(req);

            SessionClose close = new SessionClose();
            close.Close(session.SecurityValue.BinarySecurityToken);

            return modifyResult;
        }
Пример #6
0
        public HotelResModifyRS Modify(string pnr)
        {
            var session = SabreSessionManager.Create();
            ReadTravelerInfo readInfo = new ReadTravelerInfo();
            var result = readInfo.ReadInfo(session.SecurityValue.BinarySecurityToken, pnr);

            HotelResModifyRQ req = new HotelResModifyRQ();

            HotelResModifyService client = new HotelResModifyService();
            var modifyResult             = client.HotelResModifyRQ(req);

            SessionClose close = new SessionClose();

            close.Close(session.SecurityValue.BinarySecurityToken);

            return(modifyResult);
        }
Пример #7
0
        public EndTransactionRS Book(HotelSelectDto hotelSelectDto)
        {
            var session = SabreSessionManager.Create();

            hotelSelectDto.SessionId = session.SecurityValue.BinarySecurityToken;

            try
            {
                var hotelDescription = new HotelPropertyDescription()
                                       .HotelDescription(hotelSelectDto);

                var addTravelerInfo = new AddTravelerInfo()
                                      .AddTraveler(session.SecurityValue.BinarySecurityToken);

                var bookHotel = new BookHotel()
                                .Book(session.SecurityValue.BinarySecurityToken, hotelSelectDto.propertyRphNumber);

                var readTravelerInfo = new ReadTravelerInfo()
                                       .ReadInfo(session.SecurityValue.BinarySecurityToken);

                var endTransaction = new EndTransaction().End(session.SecurityValue.BinarySecurityToken);

                return(endTransaction);
                //var pnrDetails = new ReadTravelerInfo().ReadInfo(session.SecurityValue.BinarySecurityToken, endTransaction.ItineraryRef.ID);
                //return pnrDetails;
            }
            catch
            {
                throw;
            }
            finally
            {
                SessionClose close = new SessionClose();
                close.Close(session.SecurityValue.BinarySecurityToken);
            }
        }
Пример #8
0
        public OTA_HotelAvailRS Search(HotelSearchDto searchCriteria)
        {
            var session = SabreSessionManager.Create();
            OTA_HotelAvailRQ availability           = new OTA_HotelAvailRQ();
            OTA_HotelAvailRQAvailRequestSegment req = new OTA_HotelAvailRQAvailRequestSegment();
            OTA_HotelAvailRQAvailRequestSegmentHotelSearchCriteria crt =
                new OTA_HotelAvailRQAvailRequestSegmentHotelSearchCriteria();
            OTA_HotelAvailRQAvailRequestSegmentHotelSearchCriteriaCriterion cirterian =
                new OTA_HotelAvailRQAvailRequestSegmentHotelSearchCriteriaCriterion();

            OTA_HotelAvailRQAvailRequestSegmentHotelSearchCriteriaCriterionHotelRef[] refrs =
                new OTA_HotelAvailRQAvailRequestSegmentHotelSearchCriteriaCriterionHotelRef[1];
            OTA_HotelAvailRQAvailRequestSegmentHotelSearchCriteriaCriterionHotelRef ref1 =
                new OTA_HotelAvailRQAvailRequestSegmentHotelSearchCriteriaCriterionHotelRef();
            OTA_HotelAvailRQAvailRequestSegmentTimeSpan journeyDate =
                new OTA_HotelAvailRQAvailRequestSegmentTimeSpan();
            OTA_HotelAvailRQAvailRequestSegmentGuestCounts guest = new OTA_HotelAvailRQAvailRequestSegmentGuestCounts();
            Security1 sec = new Security1();
            OTA_HotelAvailRQAvailRequestSegmentPOS       pos    = new OTA_HotelAvailRQAvailRequestSegmentPOS();
            OTA_HotelAvailRQAvailRequestSegmentPOSSource source = new OTA_HotelAvailRQAvailRequestSegmentPOSSource();

            OTA_HotelAvailRQAvailRequestSegmentRatePlanCandidates ratePlan = new OTA_HotelAvailRQAvailRequestSegmentRatePlanCandidates();

            ratePlan.RateRange = new OTA_HotelAvailRQAvailRequestSegmentRatePlanCandidatesRateRange()
            {
                Min = "1"
            };

            if (searchCriteria.Address != null && searchCriteria.Address != string.Empty)
            {
                ref1.HotelCityCode = searchCriteria.Address;
            }

#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'
            if (searchCriteria.Latitude != null && searchCriteria.Longitude != null)
#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'
            {
                ref1.Latitude  = searchCriteria.Latitude.ToString("N2");
                ref1.Longitude = searchCriteria.Longitude.ToString("N2");
            }
            refrs[0]                = ref1;
            cirterian.HotelRef      = refrs;
            crt.Criterion           = cirterian;
            req.HotelSearchCriteria = crt;
            guest.Count             = searchCriteria.TotalGuest;
            req.GuestCounts         = guest;
            crt.NumProperties       = "30";

            //req.po
            var startDate = Convert.ToDateTime(searchCriteria.StartDate);
            var endDate   = Convert.ToDateTime(searchCriteria.EndDate);
            journeyDate.Start = startDate.ToString("MM-dd"); // .Month.ToString() + "-" + startDate.Day.ToString();
            journeyDate.End   = endDate.ToString("MM-dd");   //.Month.ToString() + "-" + endDate.Day.ToString();
            req.TimeSpan      = journeyDate;

            availability.AvailRequestSegment = req;

            OTA_HotelAvailService ss = new OTA_HotelAvailService();
            sec.BinarySecurityToken = session.SecurityValue.BinarySecurityToken;
            ss.Security             = sec;
            ss.MessageHeaderValue   = Get("OTA_HotelAvailLLSRQ", "");
            var          XMLRequest = Common.Utility.Serialize(availability);
            var          result     = ss.OTA_HotelAvailRQ(availability);
            SessionClose close      = new SessionClose();
            close.Close(session.SecurityValue.BinarySecurityToken);
            var XML = Common.Utility.Serialize(result);
            return(result);
        }
Пример #9
0
        public OTA_HotelAvailRS Search(HotelSearchDto searchCriteria)
        {
            var session = SabreSessionManager.Create();
            OTA_HotelAvailRQ availability = new OTA_HotelAvailRQ();
            OTA_HotelAvailRQAvailRequestSegment req = new OTA_HotelAvailRQAvailRequestSegment();
            OTA_HotelAvailRQAvailRequestSegmentHotelSearchCriteria crt =
                new OTA_HotelAvailRQAvailRequestSegmentHotelSearchCriteria();
            OTA_HotelAvailRQAvailRequestSegmentHotelSearchCriteriaCriterion cirterian =
                new OTA_HotelAvailRQAvailRequestSegmentHotelSearchCriteriaCriterion();
            OTA_HotelAvailRQAvailRequestSegmentHotelSearchCriteriaCriterionHotelRef[] refrs =
                new OTA_HotelAvailRQAvailRequestSegmentHotelSearchCriteriaCriterionHotelRef[1];
            OTA_HotelAvailRQAvailRequestSegmentHotelSearchCriteriaCriterionHotelRef ref1 =
                new OTA_HotelAvailRQAvailRequestSegmentHotelSearchCriteriaCriterionHotelRef();
            OTA_HotelAvailRQAvailRequestSegmentTimeSpan journeyDate =
                new OTA_HotelAvailRQAvailRequestSegmentTimeSpan();
            OTA_HotelAvailRQAvailRequestSegmentGuestCounts guest = new OTA_HotelAvailRQAvailRequestSegmentGuestCounts();
            Security1 sec = new Security1();
            OTA_HotelAvailRQAvailRequestSegmentPOS pos = new OTA_HotelAvailRQAvailRequestSegmentPOS();
            OTA_HotelAvailRQAvailRequestSegmentPOSSource source = new OTA_HotelAvailRQAvailRequestSegmentPOSSource();

            OTA_HotelAvailRQAvailRequestSegmentRatePlanCandidates ratePlan = new OTA_HotelAvailRQAvailRequestSegmentRatePlanCandidates();
            ratePlan.RateRange = new OTA_HotelAvailRQAvailRequestSegmentRatePlanCandidatesRateRange() { Min = "1" };

            if (searchCriteria.Address != null && searchCriteria.Address != string.Empty)
                ref1.HotelCityCode = searchCriteria.Address;

            #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'
            if (searchCriteria.Latitude != null && searchCriteria.Longitude != null)
            #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'
            {
                ref1.Latitude =  searchCriteria.Latitude.ToString("N2");
                ref1.Longitude = searchCriteria.Longitude.ToString("N2");
            }
            refrs[0] = ref1;
            cirterian.HotelRef = refrs;
            crt.Criterion = cirterian;
            req.HotelSearchCriteria = crt;
            guest.Count = searchCriteria.TotalGuest;
            req.GuestCounts = guest;
            crt.NumProperties = "30";

            //req.po
            var startDate = Convert.ToDateTime(searchCriteria.StartDate);
            var endDate = Convert.ToDateTime(searchCriteria.EndDate);
            journeyDate.Start = startDate.ToString("MM-dd");// .Month.ToString() + "-" + startDate.Day.ToString();
            journeyDate.End = endDate.ToString("MM-dd"); //.Month.ToString() + "-" + endDate.Day.ToString();
            req.TimeSpan = journeyDate;

            availability.AvailRequestSegment = req;

            OTA_HotelAvailService ss = new OTA_HotelAvailService();
            sec.BinarySecurityToken = session.SecurityValue.BinarySecurityToken;
            ss.Security = sec;
            ss.MessageHeaderValue = Get("OTA_HotelAvailLLSRQ", "");
            var XMLRequest = Common.Utility.Serialize(availability);
            var result = ss.OTA_HotelAvailRQ(availability);
            SessionClose close = new SessionClose();
            close.Close(session.SecurityValue.BinarySecurityToken);
            var XML = Common.Utility.Serialize(result);
            return result;
        }