public void Arrange() { _repo = new KomodoGreetingRepo(); _customer = new KomodoGreeting("Chloe", "Jefferson", CustomerTypeEnum.Current); _repo.AddCustomerToList(_customer); _customerUpdate = new KomodoGreeting("Chloe", "Jefferson", CustomerTypeEnum.Past); }
private void CustomerUpdate() { Console.Clear(); CustomersView(); Console.WriteLine("Enter the ID of the customer you'd like to update,"); string originalId = Console.ReadLine(); KomodoGreeting updatedCustomer = new KomodoGreeting(); Console.WriteLine("Enter the First Name of the customer."); updatedCustomer.FirstName = Console.ReadLine(); Console.WriteLine("Enter the Last Name of the customer."); updatedCustomer.LastName = Console.ReadLine(); Console.WriteLine("Enter the number associated with the type of customer below:\n" + "1. Current\n" + "2. Past\n" + "3. Potential"); updatedCustomer.CustomerType = (CustomerTypeEnum)int.Parse(Console.ReadLine()); bool wasUpdated = _customerRepo.UpdateCustomer(originalId, updatedCustomer); if (wasUpdated) { Console.WriteLine("Customer was successfully updated!"); } else { Console.WriteLine("Could not be updated. Try again."); } }
private void SeedCustomerList() { var A = new KomodoGreeting("Haley", "Jackson", CustomerTypeEnum.Current); var B = new KomodoGreeting("Jack", "Henson", CustomerTypeEnum.Past); var C = new KomodoGreeting("Jordan", "Brooks", CustomerTypeEnum.Potential); _customerRepo.AddCustomerToList(A); _customerRepo.AddCustomerToList(B); _customerRepo.AddCustomerToList(C); }
private void CustomerAdd() { Console.Clear(); KomodoGreeting newCustomer = new KomodoGreeting(); Console.WriteLine("Enter the First Name of the customer."); newCustomer.FirstName = Console.ReadLine(); Console.WriteLine("Enter the Last Name of the customer."); newCustomer.LastName = Console.ReadLine(); Console.WriteLine("Enter the number associated with the type of customer below:\n" + "1. Current\n" + "2. Past\n" + "3. Potential"); newCustomer.CustomerType = (CustomerTypeEnum)int.Parse(Console.ReadLine()); _customerRepo.AddCustomerToList(newCustomer); }