예제 #1
0
        private string getExistingRegistrationNumberFromUser()
        {
            string userInput = string.Empty;

            Console.Write(@"Please enter registration number (7 characters, 0-9, 'A'-'Z'):
>> ");
            userInput = Console.ReadLine();

            if (StringManager.IsOnlyDigitsAndCapLetters(userInput) == true && userInput.Length == 7)
            {
                if (m_Garage.IsVehicleExists(userInput) == false)
                {
                    throw new ArgumentException("Vehicle_Not_Exist");
                }
            }
            else
            {
                throw new Exception("Invalid data input");
            }

            return(userInput);
        }