예제 #1
0
파일: DriverNIF.cs 프로젝트: TiagoFBM/isep
        public DriverNIF(long nif)
        {
            if (!NumberValidator.isValidNIF(nif))
            {
                throw new BusinessRuleValidationException(nif + " invalid: Driver NIF is invalid");
            }

            if (NumberValidator.isNegative(nif))
            {
                throw new BusinessRuleValidationException(nif + " invalid: Driver NIF can't be negative");
            }

            this.nif = nif;
        }
예제 #2
0
        public CitizenCardNumber(long citizenCardNumber)
        {
            if (!NumberValidator.isValidCitizenCardNumber(citizenCardNumber))
            {
                throw new BusinessRuleValidationException(citizenCardNumber + " invalid: Driver Citizen Card Number invalid");
            }

            if (NumberValidator.isNegative(citizenCardNumber))
            {
                throw new BusinessRuleValidationException(citizenCardNumber + " invalid: Driver Citizen Card Number can't be negative");
            }

            this.citizenCardNumber = citizenCardNumber;
        }