/// <summary> /// Copies the elements of the specified <see cref="Noticeinfo">Noticeinfo</see> array to the end of the collection. /// </summary> /// <param name="value">An array of type <see cref="Noticeinfo">Noticeinfo</see> containing the Components to add to the collection.</param> public void AddRange(NoticeInfo[] value) { for (int i = 0; (i < value.Length); i = (i + 1)) { this.Add(value[i]); } }
private static NoticeInfo LoadSingleNoticeInfo(IDataReader reader) { NoticeInfo noticeinfo = new NoticeInfo(); noticeinfo.Nid = TypeConverter.ObjectToInt(reader["nid"], 0); noticeinfo.Uid = TypeConverter.ObjectToInt(reader["uid"], 0); noticeinfo.Type = (NoticeType)TypeConverter.ObjectToInt(reader["type"], 0); noticeinfo.New = TypeConverter.ObjectToInt(reader["new"], 0); noticeinfo.Posterid = TypeConverter.ObjectToInt(reader["posterid"], 0); noticeinfo.Poster = reader["poster"].ToString().Trim(); noticeinfo.Note = Utils.HtmlDecode(reader["note"].ToString()); noticeinfo.Postdatetime = reader["postdatetime"].ToString(); return noticeinfo; }
/// <summary> /// 添加指定的通知信息 /// </summary> /// <param name="noticeinfo">要添加的通知信息</param> /// <returns></returns> public static int CreateNoticeInfo(NoticeInfo noticeinfo) { return DatabaseProvider.GetInstance().CreateNoticeInfo(noticeinfo); }
/// <summary> /// 获取指定通知id的信息 /// </summary> /// <param name="nid">通知id</param> /// <returns>通知信息</returns> public static NoticeInfo GetNoticeInfo(int nid) { NoticeInfo noticeinfo = new NoticeInfo(); IDataReader idatareader = DatabaseProvider.GetInstance().GetNoticeByNid(nid); if (idatareader.Read()) { LoadSingleNoticeInfo(idatareader); } idatareader.Close(); return noticeinfo; }
/// <summary> /// Gets a value indicating whether the collection contains the specified <see cref="NoticeinfoCollection">NoticeinfoCollection</see>. /// </summary> /// <param name="value">The <see cref="NoticeinfoCollection">NoticeinfoCollection</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(NoticeInfo value) { return this.List.Contains(value); }
public int Add(NoticeInfo value) { return this.List.Add(value); }
/// <summary> /// Initializes a new instance of the <see cref="NoticeinfoCollection">NoticeinfoCollection</see> class containing the specified array of <see cref="Noticeinfo">Noticeinfo</see> Components. /// </summary> /// <param name="value">An array of <see cref="Noticeinfo">Noticeinfo</see> Components with which to initialize the collection. </param> public NoticeinfoCollection(NoticeInfo[] value) { this.AddRange(value); }
public void Remove(NoticeInfo value) { List.Remove(value); }
public void Insert(int index, NoticeInfo value) { List.Insert(index, value); }
/// <summary> /// Gets the index in the collection of the specified <see cref="NoticeinfoCollection">NoticeinfoCollection</see>, if it exists in the collection. /// </summary> /// <param name="value">The <see cref="NoticeinfoCollection">NoticeinfoCollection</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(NoticeInfo 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(NoticeInfo[] array, int index) { this.List.CopyTo(array, index); }