public override bool Verify() { if (Birthday >= DateTime.Now) { return(false); } if (!SubdivisionId.HasValue) { return(false); } if (Surname.IsNullOrEmpty() || Name.IsNullOrEmpty()) { return(false); } return(true); }
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(); }
public bool HasAllNonEmpty() { return(!Name.IsNullOrEmpty() && !Surname.IsNullOrEmpty() && !EmailAddress.IsNullOrEmpty()); }