private void updateCustomer() { Console.WriteLine("Enter the email of the customer you wish to update: "); string email = Console.ReadLine().ToLower(); Customer locatedCustomer = _repo.GetCustomerByEmail(email); if (locatedCustomer == null) { Console.WriteLine("That customer does not exist"); } else { //ask the end user for the details they wanna change _repo.UpdateCustomer(locatedCustomer, InputCustomerDetails()); Console.WriteLine("Customer has been sucessfully updated."); } }
public void SearchForCustomer() { Console.WriteLine("Customers email address: "); string email = Console.ReadLine().ToLower(); Customer locatedCustomer = _repo.GetCustomerByEmail(email); if (locatedCustomer == null) { Console.WriteLine("No such Customer found. Please press enter to continue"); Console.ReadLine(); } else { Console.WriteLine($"Customer found, hello {locatedCustomer.FirstName}"); menu = new StartOrder(_repo, locatedCustomer); menu.Start(); } }