//Update public bool UpdateItemList(string oldMealName, MenuPoco newItem) { MenuPoco oldItem = GetItemByName(oldMealName); if (oldItem != null) { oldItem.MealNumber = newItem.MealNumber; oldItem.MealName = newItem.MealName; oldItem.MealDescription = newItem.MealDescription; oldItem.IngredientsList = newItem.IngredientsList; oldItem.MealPrice = newItem.MealPrice; return(true); } else { return(false); } }
//Delete public bool RemoveItemFromList(string currentMealName) { MenuPoco currentItem = GetItemByName(currentMealName); if (currentItem == null) { return(false); } int initialCount = _listOfItems.Count(); _listOfItems.Remove(currentItem); if (initialCount > _listOfItems.Count) { return(true); } else { return(false); } }
//Create public void AddItemToList(MenuPoco item) { _listOfItems.Add(item); }