/// <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(); }
/// <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(); }
/// <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(); }
/// <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(); }
/// <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(); }
/// <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(); }
/// <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(); }