コード例 #1
0
        private PrimaryEmail GetPrimaryEmail(Applicant organization)
        {
            var primaryEmail = new PrimaryEmail()
            {
                EmailAddress = organization.Email
            };

            return(primaryEmail);
        }
コード例 #2
0
        public string GetCompanyInfoFromPrimaryEmail()
        {
            var domain = PrimaryEmail.Substring(PrimaryEmail.IndexOf("@", StringComparison.Ordinal) + 1);

            if (domain.Contains("."))
            {
                return(domain.Substring(0, domain.IndexOf(".", StringComparison.Ordinal)));
            }
            return(domain);
        }
コード例 #3
0
        protected override void Validate()
        {
            if (string.IsNullOrEmpty(PrimaryEmail) && (string.IsNullOrEmpty(FirstName) || string.IsNullOrEmpty(LastName)))
            {
                AddBrokenRule(ValueObjects.ValueObjectBusinessRule.ContactNotValid);
            }

            if (!string.IsNullOrEmpty(PrimaryEmail) && !IsValidEmail(PrimaryEmail.Trim()))
            {
                AddBrokenRule(ValueObjects.ValueObjectBusinessRule.EmailIsInvalid);
            }
        }
コード例 #4
0
        private PrimaryEmail GetPrimaryEmail(LmsPerson lmsPerson)
        {
            var applicant      = lmsPerson.Applicant;
            var authorizedUser = lmsPerson.AuthorizedUser;
            var primaryEmail   = new PrimaryEmail();

            if (applicant != null && authorizedUser == null)
            {
                primaryEmail.EmailAddress = applicant.Email;
            }
            else if (applicant == null && authorizedUser != null)
            {
                primaryEmail.EmailAddress = authorizedUser.Email;
            }

            return(primaryEmail);
        }