コード例 #1
0
        private void displayLicneseNumberListOfAllCarsInGarage()
        {
            Console.WriteLine("Would you like to see specific status of cars? choose from options below:");
            Console.WriteLine(@"1. In repair
2. Fixed and unpaid
3. Fixed and paid
4. All");
            try
            {
                string answer = UIValidation.ValidateChoiceNumberInRange(1, 4, Console.ReadLine());
                string licenseNumbertoDisplay = r_Garage.FilterLicneseNumberByGarageStatus(answer);
                if (licenseNumbertoDisplay.Equals(string.Empty) && answer.Equals("4"))
                {
                    Console.WriteLine("No Cars in the garage at the moment!");
                }
                else if (licenseNumbertoDisplay.Equals(string.Empty))
                {
                    Console.WriteLine("No Cars with this status in the garage at the moment!");
                }
                else
                {
                    Console.WriteLine(licenseNumbertoDisplay);
                }
            }
            catch (ArgumentException exception)
            {
                Console.WriteLine(exception.Message);
            }

            Console.ReadLine();
        }