public bool UpdateCurrentMenuItem(string originalMealNumber, ChallengeOneMenuProperties newMealNumber) { ChallengeOneMenuProperties oldMealNumber = FindSpecificMenuItem(int.Parse(originalMealNumber)); if (oldMealNumber != null) { oldMealNumber.MealName = newMealNumber.MealName; oldMealNumber.Description = newMealNumber.Description; oldMealNumber.IngredientList = newMealNumber.IngredientList; oldMealNumber.MealNumber = newMealNumber.MealNumber; oldMealNumber.Price = newMealNumber.Price; return(true); } else { return(false); } }
public bool RemoveMenuItem(int mealNumber) { ChallengeOneMenuProperties menuItem = FindSpecificMenuItem(mealNumber); if (menuItem == null) { return(false); } int initialCount = menuItems.Count; menuItems.Remove(menuItem); if (initialCount > menuItems.Count) { return(true); } else { return(false); } }
public void AddNewMenuItem(ChallengeOneMenuProperties menuItem) { menuItems.Add(menuItem); }