public IHttpActionResult Buy(PresentDTO presentDTO)
        {
            var presentBL = new PresentBusiness();

            presentBL.PresentID = presentDTO.Id;
            presentBL.Product   = new ProductBusiness()
            {
                Brand       = presentDTO.Product.Brand,
                Category    = presentDTO.Product.Category,
                Description = presentDTO.Product.Description,
                Id          = presentDTO.Product.Id,
                ImageName   = presentDTO.Product.ImageName,
                Name        = presentDTO.Product.Name,
                Price       = presentDTO.Product.Price,
                Stock       = presentDTO.Product.Stock,
            };
            presentBL.Status = new Tuple <bool, string>(presentDTO.Status, presentDTO.Message);
            if (this.presentListService.UpdatePresent(presentBL))
            {
                return(Ok());
            }
            else
            {
                return(InternalServerError());
            }
        }
Beispiel #2
0
        public bool UpdatePresent(PresentBusiness presentBusiness)
        {
            productsService.UpdateStockProduct(presentBusiness.Product);
            var presentDAL = presentRepository.GetPresent(presentBusiness.PresentID);

            presentDAL.Status = true;
            var updatePresentListProduct = presentRepository.UpdatePresent(presentDAL);

            return(updatePresentListProduct.Status);
        }