/// <summary>
        /// Returns a new PollOptionDetails instance filled with the DataReader's current record data
        /// </summary>
        protected virtual PollOptionDetails GetOptionFromReader(IDataReader reader)
        {
            PollOptionDetails option = new PollOptionDetails(
                (int)reader["OptionID"],
                (DateTime)reader["AddedDate"],
                reader["AddedBy"].ToString(),
                (int)reader["PollID"],
                reader["OptionText"].ToString(),
                (int)reader["Votes"],
                Convert.ToDouble(reader["Percentage"]));

            return(option);
        }
        /// <summary>
        /// Returns a new PollOptionDetails instance filled with the DataReader's current record data
        /// </summary>
        protected virtual PollOptionDetails GetOptionFromReader(IDataReader reader)
        {
            PollOptionDetails option = new PollOptionDetails(
            (int)reader["OptionID"],
            (DateTime)reader["AddedDate"],
            reader["AddedBy"].ToString(),
            (int)reader["PollID"],
            reader["OptionText"].ToString(),
            (int)reader["Votes"],
            Convert.ToDouble(reader["Percentage"]));

             return option;
        }
 public abstract bool UpdateOption(PollOptionDetails option);
 public abstract int InsertOption(PollOptionDetails option);
Ejemplo n.º 5
0
 /// <summary>
 /// Returns a Option object filled with the data taken from the input PollOptionDetails
 /// </summary>
 private static Option GetOptionFromPollOptionDetails(PollOptionDetails record)
 {
     if (record == null)
     return null;
      else
      {
     return new Option(record.ID, record.AddedDate, record.AddedBy,
        record.PollID, record.OptionText, record.Votes, record.Percentage);
      }
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Updates an existing option
 /// </summary>
 public static bool UpdateOption(int id, string optionText)
 {
     PollOptionDetails record = new PollOptionDetails(id, DateTime.Now, "",
     0, optionText, 0, 0.0);
      bool ret = SiteProvider.Polls.UpdateOption(record);
      BizObject.PurgeCacheItems("polls_option");
      return ret;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Creates a new poll option
 /// </summary>
 public static int InsertOption(int pollID, string optionText)
 {
     PollOptionDetails record = new PollOptionDetails(0, DateTime.Now, BizObject.CurrentUserName,
     pollID, optionText, 0, 0.0);
      int ret = SiteProvider.Polls.InsertOption(record);
      BizObject.PurgeCacheItems("polls_poll_" + pollID.ToString());
      BizObject.PurgeCacheItems("polls_option");
      return ret;
 }
 public abstract int InsertOption(PollOptionDetails option);
 public abstract bool UpdateOption(PollOptionDetails option);