Example #1
0
        private void RemoveUserItem()
        {
            Console.Write("Please enter the item number you would like to remove: ");
            string userInput = Console.ReadLine();
            int    itemNumber;

            if (!int.TryParse(userInput, out itemNumber))
            {
                itemNumber = -1;
            }

            Cosmetics itemToRemove = Cosmetics.GetCosmeticsItem(itemNumber);

            if (itemToRemove == null)
            {
                Console.WriteLine("Sorry, we couldn't find that item. Please try again.");
            }
            else
            {
                this.AddItem(itemToRemove);
            }
        }
Example #2
0
 public void AddItem(Cosmetics item)
 {
     this.Items[this.itemCount] = item;
     this.itemCount++;
 }
 public void AddItem(Cosmetics item)
 {
     this.Items[this.itemCount] = item;
     this.itemCount++;
 }