Esempio n. 1
0
        internal override bool CheckValidity(int i_QuestionToCheck, string i_AnswerToCheck, out string o_ErrorMessage)
        {
            VehicleCreator.eQuestionNumber questionNumber = (VehicleCreator.eQuestionNumber)i_QuestionToCheck;
            bool o_IsValid = true;

            o_ErrorMessage = "None";
            o_IsValid      = base.CheckValidity(i_QuestionToCheck, i_AnswerToCheck, out o_ErrorMessage);

            switch (questionNumber)
            {
            case VehicleCreator.eQuestionNumber.Question7:
            {
                o_IsValid = validateDangerousMaterial(i_AnswerToCheck, out o_ErrorMessage);
                break;
            }

            case VehicleCreator.eQuestionNumber.Question8:
            {
                o_IsValid = validateTrunkVolume(i_AnswerToCheck, out o_ErrorMessage);
                break;
            }

            default:
            {
                break;
            }
            }

            return(o_IsValid);
        }
Esempio n. 2
0
        internal virtual bool CheckValidity(int i_QuestionToCheck, string i_AnswerToCheck, out string o_ErrorMessage)
        {
            VehicleCreator.eQuestionNumber questionNumber = (VehicleCreator.eQuestionNumber)i_QuestionToCheck;
            bool o_IsValid = true;

            o_ErrorMessage = "None";

            switch (questionNumber)
            {
            case VehicleCreator.eQuestionNumber.Question1:
            {
                o_IsValid = validateName(i_AnswerToCheck, out o_ErrorMessage);
                break;
            }

            case VehicleCreator.eQuestionNumber.Question2:
            {
                o_IsValid = validateName(i_AnswerToCheck, out o_ErrorMessage);
                break;
            }

            case VehicleCreator.eQuestionNumber.Question3:
            {
                o_IsValid = validatePhoneNumber(i_AnswerToCheck, out o_ErrorMessage);
                break;
            }

            case VehicleCreator.eQuestionNumber.Question4:
            {
                o_IsValid = validateFuelOrElectricityQuantity(i_AnswerToCheck, out o_ErrorMessage);
                break;
            }

            case VehicleCreator.eQuestionNumber.Question5:
            {
                o_IsValid = validateName(i_AnswerToCheck, out o_ErrorMessage);
                break;
            }

            case VehicleCreator.eQuestionNumber.Question6:
            {
                o_IsValid = validateWheelPressure(i_AnswerToCheck, out o_ErrorMessage);
                break;
            }

            default:
            {
                break;
            }
            }

            return(o_IsValid);
        }