/// <summary> /// Gets an IList with page of instances of KLViewHistory. /// </summary> /// <param name="pageNumber">The page number.</param> /// <param name="pageSize">Size of the page.</param> /// <param name="totalPages">total pages</param> public static List <KLViewHistory> GetPage(int pageNumber, int pageSize, out int totalPages) { totalPages = 1; IDataReader reader = DBKLViewHistory.GetPage(pageNumber, pageSize, out totalPages); return(LoadListFromReader(reader)); }
/// <summary> /// Updates this instance of KLViewHistory. Returns true on success. /// </summary> /// <returns>bool</returns> private bool Update() { return(DBKLViewHistory.Update( this.iD, this.newsID, this.viewDate, this.viewCount)); }
/// <summary> /// Persists a new instance of KLViewHistory. Returns true on success. /// </summary> /// <returns></returns> private bool Create() { int newID = 0; newID = DBKLViewHistory.Create( this.newsID, this.viewDate, this.fromdate, this.todate); this.iD = newID; return(newID > 0); }
/// <summary> /// Gets an instance of KLViewHistory. /// </summary> /// <param name="id"> id </param> private void GetKLViewHistory( int id) { using (IDataReader reader = DBKLViewHistory.GetOne( id)) { if (reader.Read()) { this.iD = Convert.ToInt32(reader["ID"]); this.newsID = Convert.ToInt32(reader["NewsID"]); this.viewDate = Convert.ToDateTime(reader["ViewDate"]); this.viewCount = Convert.ToInt32(reader["ViewCount"]); } } }
/// <summary> /// Gets an IList with all instances of KLViewHistory. /// </summary> public static List <KLViewHistory> GetTop6(DateTime fromdate, DateTime todate) { IDataReader reader = DBKLViewHistory.GetTop6(fromdate, todate); return(LoadListFromReader(reader)); }
/// <summary> /// Gets a count of KLViewHistory. /// </summary> public static int GetCount() { return(DBKLViewHistory.GetCount()); }
/// <summary> /// Deletes an instance of KLViewHistory. Returns true on success. /// </summary> /// <param name="id"> id </param> /// <returns>bool</returns> public static bool Delete( int id) { return(DBKLViewHistory.Delete( id)); }