public async Task <IHttpActionResult> Post(ArrayProductosWithCorreo datos) { try { var productoCarritoManager = new ProductoCarritoManagement(); var userManager = new UserManagement(); var hotelManagement = new HotelManagement(); List <ProductoCarrito> productos = datos.productsArray; User tmpUser = new User { Correo = datos.correo }; User user = userManager.RetrieveByCorreo(tmpUser); CommissionHotel hotel = hotelManagement.getCommision(datos.hotel); await productoCarritoManager.SendEmailCart(productos, user, hotel); apiResponse = new ApiResponse(); return(Ok(apiResponse)); } catch (BussinessException bex) { return(InternalServerError(new Exception(bex.AppMessage.Message))); } }
public IHttpActionResult GetId(int hotel) { var hotelManager = new HotelManagement(); apiResponse = new ApiResponse(); var hotels = hotelManager.getCommision(hotel); apiResponse.Data = hotels; return(Ok(apiResponse)); }
public async System.Threading.Tasks.Task <IHttpActionResult> Post4Async(Hotel hotel) { var hotelManager = new HotelManagement(); var userManager = new UserManagement(); apiResponse = new ApiResponse(); decimal totalPrice = hotel.DailySales; CommissionHotel commissionHotel = hotelManager.getCommision(hotel.Id); User tmpUser = new User() { Correo = hotel.Email }; User user = userManager.RetrieveByCorreo(tmpUser); await hotelManager.SendMembershipEmail(commissionHotel, user, totalPrice); return(Ok(apiResponse)); }