/// <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]); } }
/// <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; }
/// <summary> /// 删除指定的投票项 /// </summary> /// <param name="pollInfoOption">投票项</param> /// <returns></returns> public static bool DeletePollOption(PollOptionInfo pollInfoOption) { return DatabaseProvider.GetInstance().DeletePollOption(pollInfoOption); }
/// <summary> /// 创建投票项 /// </summary> /// <param name="polloptioninfocoll">投票项</param> /// <returns></returns> public static void CreatePollOption(PollOptionInfo polloptioninfo) { DatabaseProvider.GetInstance().CreatePollOption(polloptioninfo); }
/// <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); }
public int Add(PollOptionInfo value) { return this.List.Add(value); }
public void Remove(PollOptionInfo value) { List.Remove(value); }
public void Insert(int index, PollOptionInfo value) { List.Insert(index, value); }
/// <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); }
/// <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); }
/// <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); }