Ejemplo n.º 1
0
        public void SupplyProduct(SupplyProductModelView supplyProduct)
        {
            UserManagement    userManagement    = new UserManagement();
            ProductManagement productManagement = new ProductManagement();
            string            token             = userManagement.GetToken();
            ProductModelView  product           = productManagement.GetProductDetails(supplyProduct.ProductId, token);

            product.UnitsInStock = (int.Parse(product.UnitsInStock) + supplyProduct.Quantity).ToString();
            productManagement.UpdateProduct(product, token);
        }
 public JsonResponse Post([FromBody] SupplyProductModelView productInfo)
 {
     try
     {
         _context.SupplyProduct(productInfo);
         return(new JsonResponse(1, "", null));
     }
     catch (Exception ex)
     {
         return(new JsonResponse(-1, ex.Message, null));
     }
 }