Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 2
0
        public void Add_Product(string name, int quantity)
        {
            CSABoxProduct newProduct = new CSABoxProduct(name, quantity);

            ProductList.Add(newProduct);
        }