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); }
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); }