Exemple #1
0
        private string getVehicleModel()
        {
            string userInput = string.Empty;

            Console.Write(@"What is your vehicle model? (Name length up to 25 characters)
>> ");
            userInput = Console.ReadLine();

            if (StringManager.CheckStringRange(userInput, m_MaxInputLength) == false)
            {
                throw new ValueOutOfRangeException("Input length", m_MinInputLength, m_MaxInputLength);
            }

            return(userInput);
        }
Exemple #2
0
        private string getUserName()
        {
            string userName = string.Empty;

            Console.Write(@"Please enter your name ('a'-'z' and 'A'-'Z', Name length up to 25 characters):
>> ");
            userName = Console.ReadLine();

            if ((StringManager.IsOnlyCharacters(userName) == true && StringManager.CheckStringRange(userName, m_MaxInputLength) == false) || StringManager.IsOnlyCharacters(userName) == false)
            {
                throw new FormatException("Input");
            }

            return(userName);
        }
Exemple #3
0
        private string getWheelsManufacture()
        {
            string userInput = string.Empty;

            Console.Write(@"What is your vehicle wheels manufacture? (Name up to 25 characters)
>> ");
            userInput = Console.ReadLine();

            if (StringManager.IsOnlyCharacters(userInput) == true)
            {
                if (StringManager.CheckStringRange(userInput, m_MaxInputLength) == false)
                {
                    throw new ValueOutOfRangeException("Input", m_MinInputLength, m_MaxInputLength);
                }
            }
            else
            {
                throw new FormatException("Wheels manufacture");
            }

            return(userInput);
        }