Exemplo n.º 1
0
        private static void showVehiclesLicensePlateNumbers()
        {
            string[] promptOptions = new string[] { "Vehicle Status", "Retrieve all" };
            showSubMenu(promptOptions, "Retrieve License Plate Numbers by:");
            int userChoice = Utils.GetUserMenuChoice(promptOptions.Length, 1);

            string[]      licensePlateNumberArray;
            List <string> licensePlateNumbersList = null;
            StringBuilder outputMessage           = new StringBuilder();

            if (userChoice == 1)
            {
                string vehicleStatus = GetVehicleStatus();
                licensePlateNumbersList = m_Garage.GetListOfLicensePlateNumbers(vehicleStatus);
                licensePlateNumberArray = licensePlateNumbersList.ToArray();
                outputMessage.AppendFormat("Vehicle License Plate Numbers of status '{0}' found:", vehicleStatus);
            }
            else
            {
                licensePlateNumbersList = m_Garage.GetListOfLicensePlateNumbers();
                licensePlateNumberArray = licensePlateNumbersList.ToArray();
                outputMessage.AppendFormat("All available License Plate Numbers:");
            }

            showSubMenu(licensePlateNumberArray, outputMessage.ToString());
        }