示例#1
0
        //Create
        public bool AddContentToList(CustomerContent content)
        {
            int startingCount = _listOfContent.Count;

            _listOfContent.Add(content);
            bool wasAdded = (_listOfContent.Count > startingCount) ? true : false;

            return(wasAdded);
        }
示例#2
0
        // 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);
            }
        }
示例#3
0
        // 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);
            }
        }