public static HotelCancelResponse Cancel(string ConfirmNo)
        {
            var UName = ConfigurationSettings.AppSettings["TBOUserName"];
            var UPass = ConfigurationSettings.AppSettings["TBOPassword"];

            HotelCancelRequest req = new HotelCancelRequest
            {
                Credentials = new AuthenticationData()
                {
                    UserName = UName,
                    Password = UPass
                },
                //RequestType = "HotelCancel",
                ConfirmationNo = ConfirmNo,
                Remarks        = "test cancel"
            };

            IHotelService proxy = TBOCredentials.CreateProxy();
            var           sid   = new Guid();

            ProviderLogger.LogHotelCancelReq(req, sid.ToString());
            HotelCancelResponse resp = new HotelCancelResponse();

            resp = proxy.HotelCancel(req);
            ProviderLogger.LogHotelCancelResp(resp, sid.ToString());
            return(resp);
        }
Exemplo n.º 2
0
        public static HotelBookingDetailResponse DetailService(string CRefNo)
        {
            var UName = ConfigurationSettings.AppSettings["TBOUserName"];
            var UPass = ConfigurationSettings.AppSettings["TBOPassword"];

            IHotelService             proxy = TBOCredentials.CreateProxy();
            HotelBookingDetailRequest req   = new HotelBookingDetailRequest
            {
                Credentials = new AuthenticationData()
                {
                    UserName = UName,
                    Password = UPass
                },
                //BookingId = BookId,
                //ConfirmationNo = ConfirmNo,
                ClientReferenceNumber = CRefNo
            };

            var sid = new Guid();

            ProviderLogger.LogBookingDetailReq(req, sid.ToString());
            HotelBookingDetailResponse resp = new HotelBookingDetailResponse();

            resp = proxy.HotelBookingDetail(req);
            ProviderLogger.LogBookingDetailRsp(resp, sid.ToString());

            return(resp);
        }
        public static HotelRoomAvailabilityResponse Availabilty(string SessionId, int ResIndex, string HotelCode, string SID)
        {
            var UName = ConfigurationSettings.AppSettings["TBOUserName"];
            var UPass = ConfigurationSettings.AppSettings["TBOPassword"];
            HotelRoomAvailabilityRequest req = new HotelRoomAvailabilityRequest
            {
                SessionId   = SessionId,
                ResultIndex = ResIndex,
                HotelCode   = HotelCode,
                IsCancellationPolicyRequired = true, // already come in Pricing
                Credentials = new AuthenticationData()
                {
                    UserName = UName,
                    Password = UPass
                }
            };

            ProviderLogger.LogRoomAvailabiltyReq(req, SID);

            IHotelService proxy = TBOCredentials.CreateProxy();
            HotelRoomAvailabilityResponse resp = new HotelRoomAvailabilityResponse();

            resp = proxy.AvailableHotelRooms(req);
            ProviderLogger.LogRoomAvailabilityProviderRsp(resp, SID);

            return(resp);
        }
        public static HotelSearchResponse Search(HotelSearchRequest req, string SID)
        {
            var UName = ConfigurationSettings.AppSettings["TBOUserName"];
            var UPass = ConfigurationSettings.AppSettings["TBOPassword"];

            IHotelService proxy = TBOCredentials.CreateProxy();

            req.Credentials = new AuthenticationData()
            {
                UserName = UName,
                Password = UPass
            };

            ProviderLogger.LogSearchProviderReq(req, SID);

            HotelSearchResponse resp      = new HotelSearchResponse();
            Stopwatch           stopWatch = new Stopwatch();

            stopWatch.Start();
            resp = proxy.HotelSearch(req);


            stopWatch.Stop();
            TimeSpan ts1 = stopWatch.Elapsed;

            ProviderLogger.LogSearchProviderRsp(resp, SID, ts1.ToString());

            return(resp);
        }
Exemplo n.º 5
0
        public static HotelBookResponse Booking(HotelBookRequest req, string SID)
        {
            var UName = ConfigurationSettings.AppSettings["TBOUserName"];
            var UPass = ConfigurationSettings.AppSettings["TBOPassword"];

            IHotelService proxy = TBOCredentials.CreateProxy();

            req.Credentials = new AuthenticationData()
            {
                UserName = UName,
                Password = UPass
            };
            req.RestrictDuplicateBooking = true;
            ProviderLogger.LogHotelBookReq(req, SID);
            HotelBookResponse resp      = new HotelBookResponse();
            Stopwatch         stopwatch = new Stopwatch();

            stopwatch.Start();
            resp = proxy.HotelBook(req);
            stopwatch.Stop();
            TimeSpan ts1          = stopwatch.Elapsed;
            TimeSpan baseInterval = new TimeSpan(0, 0, 60);

            if (ts1 > baseInterval)
            {
                BookDetail.DetailService(req.ClientReferenceNumber);
            }
            ProviderLogger.LogHotelBookResp(resp, SID);

            return(resp);
        }
Exemplo n.º 6
0
        public static AvailabilityAndPricingResponse PricingService(AvailabilityAndPricingRequest req, string SID)
        {
            var UName = ConfigurationSettings.AppSettings["TBOUserName"];
            var UPass = ConfigurationSettings.AppSettings["TBOPassword"];

            req.Credentials = new AuthenticationData()
            {
                UserName = UName,
                Password = UPass
            };

            IHotelService proxy = TBOCredentials.CreateProxy();

            ProviderLogger.LogAvailablityPricingReq(req, SID);
            AvailabilityAndPricingResponse resp = new AvailabilityAndPricingResponse();

            resp = proxy.AvailabilityAndPricing(req);
            ProviderLogger.LogAvailablityPricingProviderRsp(resp, SID);
            return(resp);
        }