示例#1
0
        //UPDATE
        public bool UpdateMeal(int id, Cafe newname)
        {
            Cafe original = GetMenuItembyId(id);

            if (original != null)
            {
                original.MealId      = newname.MealId;
                original.MealName    = newname.MealName;
                original.Description = newname.Description;
                original.Ingredients = newname.Ingredients;
                original.Price       = newname.Price;
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#2
0
        //DELETE
        public bool DeleteMeal(int mealId)
        {
            Cafe item = GetMenuItembyId(mealId);

            if (item == null)
            {
                return(false);
            }

            int initialCount = _cafeObjectList.Count;

            _cafeObjectList.Remove(item);
            if (initialCount > _cafeObjectList.Count)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#3
0
 //CREATE
 public void CreateMeal(Cafe content)
 {
     _cafeObjectList.Add(content);
 }