Esempio n. 1
0
        public bool AddNewMenuItem(KomodoCafeItem newItem)
        {
            int menuItemCount = _menuItems.Count;

            _menuItems.Add(newItem);

            return((menuItemCount < _menuItems.Count) ? true : false);
        }
Esempio n. 2
0
        public bool DeleteMenuItem(int itemNumber)
        {
            KomodoCafeItem itemToDelete = GetItemByNumber(itemNumber);

            if (itemToDelete != null)
            {
                _menuItems.Remove(itemToDelete);
                return(true);
            }
            return(false);
        }
Esempio n. 3
0
        public bool UpdateMenuItem(int itemNumber, KomodoCafeItem newItemValues)
        {
            KomodoCafeItem oldItem = GetItemByNumber(itemNumber);

            if (oldItem != null)
            {
                oldItem.MealNumber  = newItemValues.MealNumber;
                oldItem.MealName    = newItemValues.MealName;
                oldItem.Description = newItemValues.Description;
                oldItem.Ingredients = newItemValues.Ingredients;
                oldItem.Price       = newItemValues.Price;

                return(true);
            }

            return(false);
        }