コード例 #1
0
ファイル: Polls.cs プロジェクト: mfcharaf/SnitzDotNet
        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);
        }
コード例 #2
0
 public void Update(Poll poll)
 {
     pollService.Update(poll);
     Ok();
 }