示例#1
0
        private static void printLicenceNumbersOfVehicles(GarageLogic.Garage i_Garage)
        {
            Console.WriteLine("Do you want to print with filter?");
            Console.WriteLine("Press 0 for no filter, 1 for Repair In Progress, 2 for Repair Complete, 3 for Paid");
            int chosenFilter;

            while (!int.TryParse(Console.ReadLine(), out chosenFilter) || !(chosenFilter >= 0 && chosenFilter <= 3))
            {
                Console.WriteLine("Invalid filter. please choose valid filter.");
            }

            switch (chosenFilter)
            {
            case 0:
                Console.WriteLine(i_Garage.GetLicenceNumbers());
                break;

            case 1:
                Console.WriteLine(i_Garage.GetLicenceNumbers(GarageLogic.Vehicle.eVehicleState.RepairInProgress));
                break;

            case 2:
                Console.WriteLine(i_Garage.GetLicenceNumbers(GarageLogic.Vehicle.eVehicleState.RepairComplete));
                break;

            case 3:
                Console.WriteLine(i_Garage.GetLicenceNumbers(GarageLogic.Vehicle.eVehicleState.Paid));
                break;
            }
        }