コード例 #1
0
        public object GetSupplierProducts(string SupplierID)
        {
            UserManagement          userManagement    = new UserManagement();
            ProductManagement       productManagement = new ProductManagement();
            string                  token             = userManagement.GetToken();
            List <ProductModelView> products          = productManagement.GetProductBySupplierId(SupplierID, token);

            return(products);
        }
コード例 #2
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);
        }