예제 #1
0
        //Update
        public bool UpdateExistingContent(string originalItem, DevMenu newContent)
        {
            // Find the content
            DevMenu oldContent = GetContentByItem(originalItem);


            //Update the content
            if (oldContent != null)
            {
                oldContent.MealNumber  = newContent.MealNumber;
                oldContent.MealName    = newContent.MealName;
                oldContent.Description = newContent.Description;
                oldContent.Ingredients = newContent.Ingredients;
                oldContent.Price       = newContent.Price;

                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #2
0
        //Delete
        public bool RemoveContentFromList(string title)
        {
            DevMenu content = GetContentByItem(title);

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

            int initialCount = _listOfContent.Count;

            _listOfContent.Remove(content);

            if (initialCount > _listOfContent.Count)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #3
0
 //Create
 public void AddContentToList(DevMenu content)
 {
     _listOfContent.Add(content);
 }