// 更新儲存完的ListBox private void UpdateListBox() { if (_editItemMode) // 修改 { _itemsListBox.Items[_currentItemIndex] = _itemNameTextBox.Text; _productOfCategoryListBox.DataSource = _productManagementSystemPresentationModel.GetProductOfCategory(_currentCategoryIndex); } else if (_addItemMode) // 新增 { _itemsListBox.Items.Add(_productManagement.GetLatestProduct().ProductName); _productOfCategoryListBox.DataSource = _productManagementSystemPresentationModel.GetProductOfCategory(_currentCategoryIndex); } }
public void GetLatestProductTest() { int index = _productManagement.AllProducts.Count - 1; Assert.AreEqual(_productManagement.GetLatestProduct(), _productManagement.AllProducts[index]); }
// 取得新增商品詳細資料 public String[] GetLatestItemDetail() { Product product = _productManagement.GetLatestProduct(); return(product.GetProductInventoryForm()); }