Exemple #1
0
        public JsonResult SendReservationRequestEmail(string BookingNumber, string PositionId, string SendType)
        {
            try
            {
                #region Get Hotel Booking details by booking number
                //HotelsViewBookingViewModel model = new HotelsViewBookingViewModel();
                HotelReservationRequestEmail requestEmail = new HotelReservationRequestEmail()
                {
                    BookingNumber = BookingNumber,
                    PositionId    = PositionId,
                    SendType      = SendType,
                    PlacerEmail   = Request.Cookies["EmailId"],
                    PlacerUserId  = Request.Cookies["VoyagerUser_Id"],
                    WebURLInitial = HttpContext.Request.Scheme + "://" + HttpContext.Request.Host.Value
                };
                HotelReservationEmailRes response = hotelsProviders.SendHotelReservationRequestEmail(requestEmail, token).Result;
                #endregion

                if (response != null && response?.ResponseStatus?.Status != null && response?.ResponseStatus?.Status?.ToLower() == "success")
                {
                    return(Json(new { status = "success", msg = response.ResponseStatus.ErrorMessage }));
                }
                else
                {
                    return(Json(new { status = "failure", msg = response.ResponseStatus.ErrorMessage }));
                }
            }
            catch (Exception ex)
            {
                return(Json(new { status = "failure", msg = ex.Message }));
            }
        }
Exemple #2
0
 public JsonResult RemindSupplier(string BookingNumber, string PositionId, string AltSvcId)
 {
     try
     {
         #region Send RemindSupplier Mail
         HotelReservationRequestEmail requestEmail = new HotelReservationRequestEmail()
         {
             BookingNumber = BookingNumber,
             PositionId    = PositionId,
             AltSvcId      = AltSvcId,
             SendType      = "remind",
             PlacerEmail   = ckUserEmailId,
             PlacerUserId  = ckLoginUser_Id,
             WebURLInitial = HttpContext.Request.Scheme + "://" + HttpContext.Request.Host.Value
         };
         HotelReservationEmailRes response = hotelsProviders.SendHotelReservationRequestEmail(requestEmail, token).Result;
         if (response != null && response.ResponseStatus != null)
         {
             if (response.ResponseStatus.Status == "Success")
             {
                 return(Json(new { status = "success", msg = response.ResponseStatus.ErrorMessage }));
             }
             else
             {
                 return(Json(new { status = "failure", msg = response.ResponseStatus.ErrorMessage }));
             }
         }
         else
         {
             return(Json(new { status = "failure", msg = "An Error Occured." }));
         }
         #endregion
     }
     catch (Exception ex)
     {
         return(Json(new { status = "failure", msg = ex.Message }));
     }
 }
Exemple #3
0
        public async Task <HotelReservationEmailRes> SendHotelReservationRequestEmail([FromBody] HotelReservationRequestEmail request)
        {
            var response = new HotelReservationEmailRes();

            try
            {
                if (request != null)
                {
                    response = await _hotelsRepository.SendHotelReservationRequestEmail(request);

                    if (response == null)
                    {
                        response.ResponseStatus.Status       = "Failure";
                        response.ResponseStatus.ErrorMessage = "An error occurred.";
                    }
                }
                else
                {
                    response.ResponseStatus.Status       = "Failure";
                    response.ResponseStatus.ErrorMessage = "Product details can not be blank.";
                }
            }
            catch (Exception ex)
            {
                response.ResponseStatus.Status       = "Failure";
                response.ResponseStatus.ErrorMessage = "An error occurs " + ex.Message;
            }
            return(response);
        }
Exemple #4
0
        public async Task <HotelReservationEmailRes> SendHotelReservationRequestEmail(HotelReservationRequestEmail productSearchReq, string ticket)
        {
            HotelReservationEmailRes productHotelGetRes = new HotelReservationEmailRes();

            productHotelGetRes = await serviceProxy.PostData(_configuration.GetValue <string>("ServiceHotels:SendHotelReservationRequestEmail"), productSearchReq, typeof(HotelReservationEmailRes), ticket);

            return(productHotelGetRes);
        }