示例#1
0
 /// <summary>
 /// Copies the elements of the specified <see cref="PollOptionInfo">PollOptionInfo</see> array to the end of the collection.
 /// </summary>
 /// <param name="value">An array of type <see cref="PollOptionInfo">PollOptionInfo</see> containing the Components to add to the collection.</param>
 public void AddRange(PollOptionInfo[] value)
 {
     for (int i = 0; (i < value.Length); i = (i + 1))
     {
         this.Add(value[i]);
     }
 }
示例#2
0
文件: Polls.cs 项目: sword88/ASEWH
 /// <summary>
 /// 通过主题ID获取相应的投票信息
 /// </summary>
 /// <param name="tid">主题id</param>
 /// <returns>投票选项集合</returns>
 public static List<PollOptionInfo> GetPollOptionInfoCollection(int tid)
 {
     List<PollOptionInfo> pollOptionInfoList = new List<PollOptionInfo>();
     IDataReader idatareader = DatabaseProvider.GetInstance().GetPollOptionList(tid);
     PollOptionInfo polloptioninfo;
     while (idatareader.Read())
     {
         polloptioninfo = new PollOptionInfo();
         polloptioninfo.Polloptionid = TypeConverter.ObjectToInt(idatareader["polloptionid"], 0);
         polloptioninfo.Displayorder = TypeConverter.ObjectToInt(idatareader["displayorder"], 0);
         polloptioninfo.Pollid = TypeConverter.ObjectToInt(idatareader["pollid"], 0);
         polloptioninfo.Polloption = idatareader["polloption"].ToString().Trim();
         polloptioninfo.Tid = TypeConverter.ObjectToInt(idatareader["tid"], 0);
         polloptioninfo.Voternames = idatareader["voternames"].ToString().Trim();
         polloptioninfo.Votes = TypeConverter.ObjectToInt(idatareader["votes"], 0);
         pollOptionInfoList.Add(polloptioninfo);
     }
     idatareader.Close();
     return pollOptionInfoList;
 }
示例#3
0
文件: Polls.cs 项目: sword88/ASEWH
 /// <summary>
 /// 删除指定的投票项
 /// </summary>
 /// <param name="pollInfoOption">投票项</param>
 /// <returns></returns>
 public static bool DeletePollOption(PollOptionInfo pollInfoOption)
 {
     return DatabaseProvider.GetInstance().DeletePollOption(pollInfoOption);
 }
示例#4
0
文件: Polls.cs 项目: sword88/ASEWH
 /// <summary>
 /// 创建投票项
 /// </summary>
 /// <param name="polloptioninfocoll">投票项</param>
 /// <returns></returns>
 public static void CreatePollOption(PollOptionInfo polloptioninfo)
 {
     DatabaseProvider.GetInstance().CreatePollOption(polloptioninfo);
 }
示例#5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PollOptionInfoCollection">PollOptionInfoCollection</see> class containing the specified array of <see cref="PollOptionInfo">PollOptionInfo</see> Components.
 /// </summary>
 /// <param name="value">An array of <see cref="PollOptionInfo">PollOptionInfo</see> Components with which to initialize the collection. </param>
 public PollOptionInfoCollection(PollOptionInfo[] value)
 {
     this.AddRange(value);
 }
示例#6
0
 public int Add(PollOptionInfo value)
 {
     return this.List.Add(value);
 }
示例#7
0
 public void Remove(PollOptionInfo value)
 {
     List.Remove(value);
 }
示例#8
0
 public void Insert(int index, PollOptionInfo value)
 {
     List.Insert(index, value);
 }
示例#9
0
 /// <summary>
 /// Gets the index in the collection of the specified <see cref="PollOptionInfoCollection">PollOptionInfoCollection</see>, if it exists in the collection.
 /// </summary>
 /// <param name="value">The <see cref="PollOptionInfoCollection">PollOptionInfoCollection</see> to locate in the collection.</param>
 /// <returns>The index in the collection of the specified object, if found; otherwise, -1.</returns>
 public int IndexOf(PollOptionInfo value)
 {
     return this.List.IndexOf(value);
 }
示例#10
0
 /// <summary>
 /// Copies the collection Components to a one-dimensional <see cref="T:System.Array">Array</see> instance beginning at the specified index.
 /// </summary>
 /// <param name="array">The one-dimensional <see cref="T:System.Array">Array</see> that is the destination of the values copied from the collection.</param>
 /// <param name="index">The index of the array at which to begin inserting.</param>
 public void CopyTo(PollOptionInfo[] array, int index)
 {
     this.List.CopyTo(array, index);
 }
示例#11
0
 /// <summary>
 /// Gets a value indicating whether the collection contains the specified <see cref="PollOptionInfoCollection">PollOptionInfoCollection</see>.
 /// </summary>
 /// <param name="value">The <see cref="PollOptionInfoCollection">PollOptionInfoCollection</see> to search for in the collection.</param>
 /// <returns><b>true</b> if the collection contains the specified object; otherwise, <b>false</b>.</returns>
 public bool Contains(PollOptionInfo value)
 {
     return this.List.Contains(value);
 }