Example #1
0
        public AddBookingResponseDto AddBooking([FromBody] AddBookingRequestDto request)
        {
            if (request == null || request.Booking == null || request.Booking.PropertyId <= 0)
            {
                throw new PmsException("Room Booking can not be done.");
            }

            var response      = new AddBookingResponseDto();
            var bookingId     = -1;
            var guestId       = -1;
            var roomBookingId = -1;

            if (_iPmsLogic.AddBooking(request.Booking, ref bookingId, ref guestId, ref roomBookingId))
            {
                response.ResponseStatus    = PmsApiStatus.Success.ToString();
                response.StatusDescription = "Booking is done successfully.";
                response.BookingId         = bookingId;
                response.RoomBookingId     = roomBookingId;
                response.GuestId           = guestId;
            }
            else
            {
                response.ResponseStatus    = PmsApiStatus.Failure.ToString();
                response.StatusDescription = "Booking is failed.Contact administrator.";
                response.BookingId         = -1;
                response.GuestId           = -1;
                response.RoomBookingId     = -1;
            }

            return(response);
        }