Esempio n. 1
0
        public async Task <HotelReservationEmailRes> UpdateHotelAvailabilityRequest([FromBody] AvailabilityRequestDetailsSetReq request)
        {
            var response = new HotelReservationEmailRes();

            try
            {
                if (request != null && request.UpdateReqDetails != null && request.AltSvcRoomsAndPrices != null &&
                    !string.IsNullOrEmpty(request.BookingNumber) && !string.IsNullOrEmpty(request.PositionId) && !string.IsNullOrEmpty(request.AltSvcId))
                {
                    response = await _hotelsRepository.UpdateHotelAvailabilityRequest(request);

                    if (response == null)
                    {
                        response.ResponseStatus.Status       = "Failure";
                        response.ResponseStatus.ErrorMessage = "An error occurred.";
                    }
                }
                else
                {
                    response.ResponseStatus.Status       = "Failure";
                    response.ResponseStatus.ErrorMessage = "Booking details can not be blank.";
                }
            }
            catch (Exception ex)
            {
                response.ResponseStatus.Status       = "Failure";
                response.ResponseStatus.ErrorMessage = "An error occurs " + ex.Message;
            }
            return(response);
        }
Esempio n. 2
0
        public async Task <HotelReservationEmailRes> UpdateHotelAvailabilityRequest(AvailabilityRequestDetailsSetReq AvailabilityReq)
        {
            HotelReservationEmailRes AvailibilityGetRes = new HotelReservationEmailRes();

            AvailibilityGetRes = await serviceProxy.PostData(_configuration.GetValue <string>("ServiceHotels:UpdateHotelAvailabilityRequest"), AvailabilityReq, typeof(HotelReservationEmailRes));

            return(AvailibilityGetRes);
        }
Esempio n. 3
0
        public ActionResult UpdateAvailabilityRequest(UpdateAvailabilityViewModel model, string command, string clr = "email")
        {
            try
            {
                string[] commands = command.Split("~");
                AvailabilityRequestDetailsSetReq requestAvailability = new AvailabilityRequestDetailsSetReq()
                {
                    BookingNumber        = model.BookingNumber,
                    PositionId           = model.PositionId,
                    AltSvcId             = model.AltSvcId,
                    QRFID                = model.COHeaderViewModel.QRFID,
                    AltSvcRoomsAndPrices = model.RoomRateDetails,
                    UpdateReqDetails     = model.UpdateReqDetails,
                    Status               = commands[0],
                    UserEmailId          = ckUserEmailId,
                    Caller               = commands[1],
                    PlacerUserId         = ckLoginUser_Id,
                    BudgetSupplements    = model.BudgetSupplements
                };
                HotelReservationEmailRes response = hotelsProviders.UpdateHotelAvailabilityRequest(requestAvailability).Result;

                if (response.ResponseStatus.Status == "Success")
                {
                    model.Status = "success";
                }
                else
                {
                    model.Status = "error"; model.StatusMessage = response.ResponseStatus.ErrorMessage;
                }

                if (commands[1] == "ui")
                {
                    return(RedirectToAction("ViewHotelsByBooking", new { BookingNo = model.BookingNumber }));
                }
                else
                {
                    return(View("HotelAvailabilityRequest", model));
                }
                //return RedirectToAction("HotelAvailabilityRequest", new { bn = model.BookingNumber, pid = model.PositionId, asid = model.AltSvcId, st = model.Status, avl = command });
            }
            catch (Exception ex)
            {
                return(View());
            }
        }