//View existing Customers by Name
        private void DisplayCustomerByLastName()
        {
            Console.Clear();
            DisplayAllCustomers();
            Console.WriteLine("Enter the last name of the customer you'd like to view");

            //get input and find content
            string lastName = Console.ReadLine();

            Customer customer = _customerRepo.GetCustomerByLastName(lastName);

            //Display info it customer exists
            if (customer != null)
            {
                Console.WriteLine($"Name: {customer.FullName}\n" +
                                  $"Follow the speed limit skill: {customer.FollowSpeedLimitSkill}\n" +
                                  $"Stay in their lane skill: {customer.StayInLaneSkill}\n" +
                                  $"Full stop at stop sign skill: {customer.FullStopSkill}\n" +
                                  $"Following Distance Skill: {customer.FollowingDistanceSkill}");
            }
            else
            {
                Console.WriteLine("No Customer exists by that name");
            }
        }
Esempio n. 2
0
        //View Existing Customer By Last Name
        private void DisplayCustomerByLastName()
        {
            Console.Clear();

            //Ask for last name
            DisplayAllCustomers();
            Console.WriteLine("Enter the last name of the customer you'd like to view.");

            //Get input and find content
            Customer customer = _customerRepo.GetCustomerByLastName(Console.ReadLine().ToLower());

            //Display Customer if it isn't null
            if (customer != null)
            {
                Console.WriteLine($"Fist Name: {customer.FirstName}\n" +
                                  $"Last Name: {customer.LastName}\n" +
                                  $"Type of Customer: {customer.TypeOfCustomer}\n" +
                                  $"Email that will be sent: {customer.Email}");
            }
            else
            {
                Console.WriteLine("There are no customers by that last name.");
            }
        }