Beispiel #1
0
        public bool UpdateCustomer(string originaliD, KomodoGreeting updatedCustomer)
        {
            KomodoGreeting originalCustomer = GetCustomerById(originaliD);

            if (originalCustomer != null)
            {
                originalCustomer.FirstName    = updatedCustomer.FirstName;
                originalCustomer.LastName     = updatedCustomer.LastName;
                originalCustomer.CustomerType = updatedCustomer.CustomerType;
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #2
0
        public bool DeleteCustomer(string id)
        {
            KomodoGreeting customer = GetCustomerById(id);

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

            int initialCount = _customersToGreetRepo.Count;

            _customersToGreetRepo.Remove(customer);

            if (initialCount == _customersToGreetRepo.Count + 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #3
0
 public void AddCustomerToList(KomodoGreeting customer)
 {
     _customersToGreetRepo.Add(customer);
 }