public bool DeleteItemByIndex(int removeProductIndex) { if (removeProductIndex >= 0 && removeProductIndex < ProductList.Count) { CSABoxProduct removeProduct = ProductList[removeProductIndex]; ProductList.RemoveAt(removeProductIndex); Console.WriteLine($"Your item {removeProduct.ProductName} has been successfully removed."); return(true); } else { return(false); } }
public void Add_Product(string name, int quantity) { CSABoxProduct newProduct = new CSABoxProduct(name, quantity); ProductList.Add(newProduct); }