private bool Update() { return(DBPollOption.Update( optionGuid, answer, order)); }
public bool Delete() { if (optionGuid == Guid.Empty) { return(false); } return(DBPollOption.Delete(optionGuid)); }
public bool IncrementVotes(Guid userGuid) { if (optionGuid == Guid.Empty) { return(false); } return(DBPollOption.IncrementVotes(pollGuid, optionGuid, userGuid)); }
private bool Create() { optionGuid = newOptionGuid; int rowsAffected = DBPollOption.Add( optionGuid, pollGuid, answer, order); return(rowsAffected > 0); }
private void GetPollOption(Guid optionGuid) { using (IDataReader reader = DBPollOption.GetPollOption(optionGuid)) { if (reader.Read()) { this.pollGuid = new Guid(reader["PollGuid"].ToString()); this.answer = reader["Answer"].ToString(); this.order = int.Parse(reader["Order"].ToString()); this.votes = int.Parse(reader["Votes"].ToString()); this.optionGuid = optionGuid; } } }
public static List <PollOption> GetOptionsByPollGuid(Guid pollGuid) { IDataReader reader = DBPollOption.GetPollOptions(pollGuid); return(LoadListFromReader(reader)); }