Beispiel #1
0
 /// <summary>
 /// Updates the option specified by answerID.
 /// </summary>
 /// <param name="optionID">The ID of the option to update.</param>
 /// <param name="pollID">The ID poll to add the option to.</param>
 /// <param name="text">The text of the option.</param>
 /// <param name="displayOrder">The order in which the option will be displayed.</param>
 public static void UpdateOption(Int32 optionID, Int32 pollID, String text, Int32 displayOrder)
 {
     if (text == null)
     {
         throw new ArgumentNullException("text");
     }
     Polling.Provider.UpdateOption(optionID, pollID, text, displayOrder);
     Polling.ClearCache();
 }
Beispiel #2
0
 /// <summary>
 /// Updates the write-in vote specified by writeInVoteID.
 /// </summary>
 /// <param name="voteID">The ID of the write-in vote to update.</param>
 /// <param name="text">The text of the answer.</param>
 public static void UpdateWriteInVote(Guid voteID, String text)
 {
     if (text == null)
     {
         text = "";
     }
     Polling.Provider.UpdateWriteInVote(voteID, text);
     Polling.ClearCache();
 }
Beispiel #3
0
 /// <summary>
 /// Logs a vote for the given poll with the given write-in answer.
 /// </summary>
 /// <param name="pollID">The poll being voted on.</param>
 /// <param name="writeInText">The text written in by the user.</param>
 /// <param name="voteRating">The rating of the vote.</param>
 public static void AddWriteInVote(Int32 pollID, String writeInText, Int32 voteRating)
 {
     if (writeInText == null)
     {
         throw new ArgumentNullException("writeInText");
     }
     if (writeInText.Trim().Length == 0)
     {
         throw new ArgumentException(Resources.Polling_StringCannotBeEmpty, "writeInText");
     }
     Polling.Provider.AddWriteInVote(Polling.MemberName, Polling.IPAddress, pollID, writeInText, voteRating);
     Polling.SetUserVotedCookie(pollID);
     Polling.ClearCache();
 }
Beispiel #4
0
 /// <summary>
 /// Updates the poll specified by pollID.
 /// </summary>
 /// <param name="pollID">The ID of the poll to update.</param>
 /// <param name="text">The text of the question of the poll.</param>
 /// <param name="startDate">The date and time on which the poll will start.</param>
 /// <param name="voteMode">The selection mode of the poll, single or multiple.</param>
 /// <param name="enabled">Whether the poll is enabled or not.</param>
 /// <param name="allowWriteIns">Whether the poll allows write-in votes.</param>
 /// <param name="category">The category of the poll.</param>
 public static void UpdatePoll(Int32 pollID, String text, DateTime startDate, VoteSelectionMode voteMode, Boolean enabled, Boolean allowWriteIns, String category)
 {
     if (text == null)
     {
         throw new ArgumentNullException("text");
     }
     if (!Enum.IsDefined(typeof(VoteSelectionMode), voteMode))
     {
         throw new System.ComponentModel.InvalidEnumArgumentException("voteMode", (Int32)voteMode, typeof(VoteSelectionMode));
     }
     if (category == null)
     {
         category = String.Empty;
     }
     Polling.Provider.UpdatePoll(pollID, text, startDate, voteMode, enabled, allowWriteIns, category);
     Polling.ClearCache();
 }
Beispiel #5
0
 /// <summary>
 /// Resets the given poll to no votes.
 /// </summary>
 /// <param name="pollID">The ID of the poll to reset.</param>
 public static void ResetPoll(Int32 pollID)
 {
     Polling.Provider.ResetPoll(pollID);
     Polling.ClearCache();
 }
Beispiel #6
0
 /// <summary>
 /// Deletes the write-in vote specified by ID.
 /// </summary>
 /// <param name="voteID">The ID of the vote to delete.</param>
 public static void DeleteVote(Guid voteID)
 {
     Polling.Provider.DeleteVote(voteID);
     Polling.ClearCache();
 }
Beispiel #7
0
 /// <summary>
 /// Deletes the given option.
 /// </summary>
 /// <param name="optionID">The ID of the option to delete.</param>
 public static void DeleteOption(Int32 optionID)
 {
     Polling.Provider.DeleteOption(optionID);
     Polling.ClearCache();
 }
Beispiel #8
0
 /// <summary>
 /// Deletes the given poll.
 /// </summary>
 /// <param name="pollID">The ID of the poll to delete.</param>
 public static void DeletePoll(Int32 pollID)
 {
     Polling.Provider.DeletePoll(pollID);
     Polling.ClearCache();
 }
Beispiel #9
0
 /// <summary>
 /// Logs a vote for the given poll and option.
 /// </summary>
 /// <param name="pollID">The poll being voted on.</param>
 /// <param name="optionID">The option being voted for.</param>
 /// <param name="voteRating">The rating of the vote.</param>
 public static void AddVote(Int32 pollID, Int32 optionID, Int32 voteRating)
 {
     Polling.Provider.AddVote(Polling.MemberName, Polling.IPAddress, pollID, optionID, voteRating);
     Polling.SetUserVotedCookie(pollID);
     Polling.ClearCache();
 }