Example #1
0
        private EmailCampaign GetEmailCampaign(Industry industry, bool emailingIsDisabled)
        {
            if (emailingIsDisabled)
            {
                return(EmailCampaign.None);
            }

            if (industry == Industry.Cars)
            {
                return(EmailCampaign.LatestCarModels);
            }

            if (industry == Industry.Pharmacy)
            {
                return(EmailCampaign.PharmacyNews);
            }

            if (industry == Industry.Other)
            {
                return(EmailCampaign.Generic);
            }

            throw new ArgumentException();
        }
 public virtual void UpdateIndustry(Industry industry)
 {
     EmailingSettings = EmailingSettings.ChangeIndustry(industry);
 }
 public Customer(CustomerName name, Email primaryEmail, Maybe <Email> secondaryEmail, Industry industry)
     : this()
 {
     _name            = name;
     _primaryEmail    = primaryEmail;
     SecondaryEmail   = secondaryEmail;
     EmailingSettings = new EmailingSettings(industry, false);
     Status           = CustomerStatus.Regular;
 }
Example #4
0
 public EmailingSettings ChangeIndustry(Industry industry)
 {
     return(new EmailingSettings(industry, EmailingIsDisabled));
 }
Example #5
0
 public EmailingSettings(Industry industry, bool emailingIsDisabled)
     : this()
 {
     Industry           = industry;
     EmailingIsDisabled = emailingIsDisabled;
 }