예제 #1
0
        public override bool Verify()
        {
            if (Birthday >= DateTime.Now)
            {
                return(false);
            }

            if (!SubdivisionId.HasValue)
            {
                return(false);
            }

            if (Surname.IsNullOrEmpty() || Name.IsNullOrEmpty())
            {
                return(false);
            }

            return(true);
        }
예제 #2
0
 public void Validate()
 {
     if (Name.IsNullOrEmpty())
     {
         throw new CustomerInvalidException("Name should not be emtpy or null");
     }
     if (Surname.IsNullOrEmpty())
     {
         throw new CustomerInvalidException("Surname should not be emtpy or null");
     }
     if (TelephoneNumber.IsNullOrEmpty())
     {
         throw new CustomerInvalidException("TelephoneNumber should not be emtpy or null");
     }
     if (Address.IsNull())
     {
         throw new CustomerInvalidException("Address should not be null");
     }
     Address.Validate();
 }
예제 #3
0
 public bool HasAllNonEmpty()
 {
     return(!Name.IsNullOrEmpty() &&
            !Surname.IsNullOrEmpty() &&
            !EmailAddress.IsNullOrEmpty());
 }