Exemplo n.º 1
0
        public bool UpdateCafeMenuMeal(string oldMealName, CafeMenu newMenuItem)
        {
            CafeMenu oldMenuItem = SearchMealByName(oldMealName);

            if (oldMenuItem != null)
            {
                oldMenuItem.MealName    = newMenuItem.MealName;
                oldMenuItem.Description = newMenuItem.Description;
                oldMenuItem.MealNumber  = newMenuItem.MealNumber;
                oldMenuItem.Ingredient  = newMenuItem.Ingredient;
                oldMenuItem.Price       = newMenuItem.Price;
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 2
0
        public bool RemoveMealFromMenu(int mealNumber)
        {
            CafeMenu menuItem = SearchMealNumber(mealNumber);

            if (menuItem == null)
            {
                return(false);
            }
            int initialCount = _listOfMenuItems.Count;

            _listOfMenuItems.Remove(menuItem);

            if (initialCount > _listOfMenuItems.Count)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 3
0
 public void AddToCafeMenu(CafeMenu menuItem)
 {
     _listOfMenuItems.Add(menuItem);
 }