public void EditProductQuantityTest() { _productManagement._writeNewData += EventHandler; _productManagement.EditProductQuantity(_productManagement.AllProducts[0], 5); Assert.AreEqual(_productManagement.AllProducts[0].ProductQuantity, "10"); _productManagement._writeNewData += EventHandler; }
// 更新購買後庫存 public void UpdateProductQuantity() { foreach (Product product in _itemNameAndSellNumber.Keys.ToArray()) { int originalStock = int.Parse(product.ProductQuantity); _productManagement.EditProductQuantity(product, -int.Parse(_itemNameAndSellNumber[product])); } _itemNameAndSellNumber.Clear(); }
// 補貨完 更新庫存數量 public void UpdateQuantity(int rowIndex) { _productManagement.EditProductQuantity(this.GetEditProduct(rowIndex), int.Parse(_replenishmentNumber)); }