//Create public bool AddContentToList(CustomerContent content) { int startingCount = _listOfContent.Count; _listOfContent.Add(content); bool wasAdded = (_listOfContent.Count > startingCount) ? true : false; return(wasAdded); }
// Update public bool UpdateCustomerContent(string originalName, CustomerContent newContent) { CustomerContent oldContent = GetCustomerByName(originalName); if (oldContent != null) { oldContent.FirstName = newContent.FirstName; oldContent.LastName = newContent.LastName; oldContent.TypeOfCustomer = newContent.TypeOfCustomer; oldContent.Email = newContent.Email; return(true); } else { return(false); } }
// Delete public bool RemoveGreetingContent(string fullName) { CustomerContent content = GetCustomerByName(fullName); if (content == null) { return(false); } int initialCount = _listOfContent.Count; _listOfContent.Remove(content); if (initialCount > _listOfContent.Count) { return(true); } else { return(false); } }