Exemplo n.º 1
0
        public static void UpdateTopicPoll(int pollId, string question, SortedList <int, string> choices)
        {
            PollInfo poll = new PollInfo {
                Id = pollId, DisplayText = question, Choices = null
            };

            foreach (var choice in choices)
            {
                if (poll.Choices == null)
                {
                    poll.Choices = new List <PollChoiceInfo>();
                }
                poll.Choices.Add(new PollChoiceInfo {
                    DisplayText = choice.Value, Order = choice.Key, PollId = pollId
                });
            }
            IPoll dal = Factory <IPoll> .Create("Poll");

            dal.Update(poll);
        }
 public void Update(Poll poll)
 {
     pollService.Update(poll);
     Ok();
 }