コード例 #1
0
ファイル: DriverNIF.cs プロジェクト: TiagoFBM/isep
 public override bool Equals(object obj)
 {
     if ((obj == null) || !this.GetType().Equals(obj.GetType()))
     {
         return(false);
     }
     else
     {
         DriverNIF driverNIF = (DriverNIF)obj;
         return(this.nif.Equals(driverNIF.nif));
     }
 }
コード例 #2
0
ファイル: CitizenCard.cs プロジェクト: TiagoFBM/isep
        public CitizenCard(string driverName, string birthDate, long citizenCardNumber, long driverNIF)
        {
            if (StringValidator.isStringEmptyOrNull(driverName))
            {
                throw new BusinessRuleValidationException(driverName + " invalid: Driver Name: can't be null or empty.");
            }

            if (StringValidator.isStringEmptyOrNull(birthDate))
            {
                throw new BusinessRuleValidationException(birthDate + " invalid: Driver Birth Date: can't be null or empty.");
            }

            this.Id                = new CitizenCardId(Guid.NewGuid());
            this.driverName        = new Name(driverName);
            this.birthDate         = new BirthDate(birthDate);
            this.citizenCardNumber = new CitizenCardNumber(citizenCardNumber);
            this.driverNIF         = new DriverNIF(driverNIF);
        }