예제 #1
0
        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)));
            }
        }
예제 #2
0
        public IHttpActionResult Post2(ProductoCarrito prod)
        {
            var productoCarritoManager = new ProductoCarritoManagement();

            apiResponse = new ApiResponse();
            var productos = productoCarritoManager.RetrieveAllByUser(prod.FkCarrito);

            apiResponse.Data = productos;
            return(Ok(apiResponse));
        }
예제 #3
0
        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)));
            }
        }