Ejemplo n.º 1
0
        public bool SendVoterTestMessage(out string error)
        {
            var voterIdType = UserSession.VoterIdType;

            if (voterIdType == VoterIdTypeEnum.Email)
            {
                var emailHelper = new EmailHelper();
                return(emailHelper.SendVoterTestMessage(UserSession.VoterId, out error));
            }

            if (voterIdType == VoterIdTypeEnum.Phone)
            {
                var smsHelper = new SmsHelper();
                return(smsHelper.SendVoterTestMessage(UserSession.VoterId, out error));
            }

            error = "Invalid voter type: " + voterIdType;
            return(false);
        }
Ejemplo n.º 2
0
        public bool SendWhenBallotSubmitted(Person person, Election election, out string notificationType, out string error)
        {
            var voterIdType = UserSession.VoterIdType;

            if (voterIdType == VoterIdTypeEnum.Email)
            {
                var emailHelper = new EmailHelper();
                notificationType = "email";
                return(emailHelper.SendWhenBallotSubmitted(person, election, out error));
            }

            if (voterIdType == VoterIdTypeEnum.Phone)
            {
                var smsHelper = new SmsHelper();
                notificationType = "text message";
                return(smsHelper.SendWhenBallotSubmitted(person, election, out error));
            }

            error            = "Invalid voter type: " + voterIdType;
            notificationType = null;
            return(false);
        }