//Update public bool UpdateExistingContent(string originalTypeOfEvent, EventContent newContent) { //Find the Content EventContent oldContent = GetContentByTypeOfEvent(originalTypeOfEvent); //Update the content if (oldContent != null) { oldContent.TypeOfEvent = newContent.TypeOfEvent; oldContent.DateOfEvent = newContent.DateOfEvent; oldContent.NumberOfPeopleThatAttend = newContent.NumberOfPeopleThatAttend; oldContent.CostPerPerson = newContent.CostPerPerson; oldContent.TotalCostOfEvent = newContent.TotalCostOfEvent; return(true); } else { return(false); } }
//Delete public bool RemoveContentFromList(string typeOfEvent) { EventContent content = GetContentByTypeOfEvent(typeOfEvent); if (content == null) { return(false); } int initialCount = _listOfContent.Count; _listOfContent.Remove(content); if (initialCount > _listOfContent.Count) { return(true); } else { return(false); } }
//Create public void AddContentToList(EventContent content) { _listOfContent.Add(content); }