//Create public bool AddCustomerToDirectory(KomodoCustomer customer) { int startingCount = _customerDirectory.Count; _customerDirectory.Add(customer); bool wasAdded = (_customerDirectory.Count > startingCount) ? true : false; return(wasAdded); }
public bool UpdateExistingCustomerByLastName(string lastname, KomodoCustomer newCustomer) { KomodoCustomer oldCustomer = GetCustomerByLastName(lastname); if (oldCustomer != null) { oldCustomer.CustomerID = newCustomer.CustomerID; //Read Only oldCustomer.LastName = newCustomer.LastName; oldCustomer.EnrollmentDate = newCustomer.EnrollmentDate; oldCustomer.BirthDate = newCustomer.BirthDate; return(true); } else { return(false); } }
// Delete public bool DeleteExistingCustomer(KomodoCustomer existingCustomer) { bool deleteResult = _customerDirectory.Remove(existingCustomer); return(deleteResult); }