Esempio n. 1
0
 public BookingStatusResponse GetBookingStatus(BookingStatusRequest request)
 {
     return(new BookingStatusResponse
     {
         ConfirmationNumber = request.ConfirmationNumber,
         BookingNumber = request.BookingNumber,
         StatusCode = BookingStatus.Confirmed
     });
 }
Esempio n. 2
0
        public void TestReservationStatus()
        {
            var request = new BookingStatusRequest {
                BookingNumber = "D35F673C-728F-447C-9872-F6F8D05CE0C7", LastName = "Narayanappa"
            };
            var response = new WorkerRepository().GetBookingStatus(request);

            Assert.IsNotNull(response);
            Assert.IsNotNull(response.StatusCode);
        }
        public async Task <BookingStatusResponse> BookingStatus(BookingStatusRequest bookingStatusModel, ViatorSetting setting = null)
        {
            var uri      = $"/service/booking/status";
            var response = await _httpClient.PostAsync <BookingStatusRequest>(GenerateBaseURL(uri, setting), bookingStatusModel);

            if (response.IsSuccessStatusCode)
            {
                var content = response.Content.ReadAsStringAsync().Result;
                var result  = BookingStatusResponse.FromJson(content);
                return(result);
            }
            else
            {
                throw new Exception("Viator API - Booking Status: Api error response");
            }
        }
Esempio n. 4
0
        public BookingStatusResponse GetBookingStatus(BookingStatusRequest request)
        {
            var response = new BookingStatusResponse();

            using (var context = new SpartanHotelsEntities())
            {
                var userReservation = context.Reservations.FirstOrDefault(rs => (rs.BookingNum == request.BookingNumber));

                if (userReservation != null)
                {
                    response.BookingNumber      = userReservation.BookingNum;
                    response.ConfirmationNumber = userReservation.ConfirmationNum.ToString();
                    response.StatusCode         = (BookingStatus)userReservation.BookStatusID;
                }
                else
                {
                    //return.. invalid input, reservation doesnt exists
                }
            }

            return(response);
        }
Esempio n. 5
0
        public BookingStatusResponse GetBookingStatus(BookingStatusRequest request)
        {
            var dbAccess = new DbAccess();

            return(dbAccess.GetBookingStatus(request));
        }
 public JsonResult Get(BookingStatusRequest request)
 {
     return(Json(status.GetBookingStatus(request)));
 }