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 Post2(ProductoCarrito prod) { var productoCarritoManager = new ProductoCarritoManagement(); apiResponse = new ApiResponse(); var productos = productoCarritoManager.RetrieveAllByUser(prod.FkCarrito); apiResponse.Data = productos; return(Ok(apiResponse)); }
public IHttpActionResult Post(ArrayProductos arrayProductos) { try { var productoCarritoManager = new ProductoCarritoManagement(); productoCarritoManager.CreateList(arrayProductos); apiResponse = new ApiResponse(); return(Ok(apiResponse)); } catch (BussinessException bex) { return(InternalServerError(new Exception(bex.AppMessage.Message))); } }