Beispiel #1
0
        public static PollAnswer Create(Guid pollId, string name)
        {
            try
            {
                var pollAnswer = new Internal.PollAnswer();
                pollAnswer.PollId = pollId;
                pollAnswer.Name   = name;

                Internal.PollingService.AddUpdatePollAnswer(pollAnswer);

                return(Get(pollAnswer.Id));
            }
            catch (Exception ex)
            {
                return(new PollAnswer(new AdditionalInfo(new Error(ex.GetType().FullName, ex.Message))));
            }
        }
Beispiel #2
0
        public static PollAnswer Create(Guid pollId, string name)
        {
            try
            {
                var pollAnswer = new Internal.PollAnswer();
                pollAnswer.PollId = pollId;
                pollAnswer.Name = name;

                Internal.PollingService.AddUpdatePollAnswer(pollAnswer);

                return Get(pollAnswer.Id);
            }
            catch (Exception ex)
            {
                return new PollAnswer(new AdditionalInfo(new Error(ex.GetType().FullName, ex.Message)));
            }
        }
 internal PollAnswer(Internal.PollAnswer pollAnswer, InternalApi.Poll poll)
     : base()
 {
     _pollAnswer     = pollAnswer;
     _hideVoteCounts = poll.HideResultsUntilVotingComplete && poll.VotingEndDateUtc.HasValue && DateTime.UtcNow > poll.VotingEndDateUtc.Value;
 }
Beispiel #4
0
 internal PollAnswer(Internal.PollAnswer pollAnswer, InternalApi.Poll poll)
     : base()
 {
     _pollAnswer = pollAnswer;
     _hideVoteCounts = poll.HideResultsUntilVotingComplete && poll.VotingEndDateUtc.HasValue && DateTime.UtcNow > poll.VotingEndDateUtc.Value;
 }