/// <summary> /// Gets an IList with page of instances of KLBook. /// </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 <KLBook> GetPage(int pageNumber, int pageSize, out int totalPages) { totalPages = 1; IDataReader reader = DBKLBook.GetPage(pageNumber, pageSize, out totalPages); return(LoadListFromReader(reader)); }
public static List <KLBook> GetPageByAuthorid(int pageNumber, int pageSize, out int totalPages, int authorid, string keyword) { totalPages = 1; IDataReader reader = DBKLBook.GetPageByAuthorid(pageNumber, pageSize, out totalPages, authorid, keyword); return(LoadListFromReader(reader)); }
/// <summary> /// Updates this instance of KLBook. Returns true on success. /// </summary> /// <returns>bool</returns> private bool Update() { return(DBKLBook.Update( this.bookID, this.authorID, this.title, this.image, this.url, this.description, this.isPublish, this.isDelected)); }
/// <summary> /// Persists a new instance of KLBook. Returns true on success. /// </summary> /// <returns></returns> private bool Create() { int newID = 0; newID = DBKLBook.Create( this.authorID, this.title, this.image, this.url, this.description, this.isPublish, this.isDelected); this.bookID = newID; return(newID > 0); }
/// <summary> /// Gets an instance of KLBook. /// </summary> /// <param name="bookID"> bookID </param> private void GetKLBook( int bookID) { using (IDataReader reader = DBKLBook.GetOne( bookID)) { if (reader.Read()) { this.bookID = Convert.ToInt32(reader["BookID"]); this.authorID = Convert.ToInt32(reader["AuthorID"]); this.title = reader["Title"].ToString(); this.image = reader["Image"].ToString(); this.url = reader["Url"].ToString(); this.description = reader["Description"].ToString(); this.isPublish = Convert.ToBoolean(reader["IsPublish"]); this.isDelected = Convert.ToBoolean(reader["IsDelected"]); } } }
/// <summary> /// Gets an IList with all instances of KLBook. /// </summary> public static List <KLBook> GetAll() { IDataReader reader = DBKLBook.GetAll(); return(LoadListFromReader(reader)); }
/// <summary> /// Gets a count of KLBook. /// </summary> public static int GetCount() { return(DBKLBook.GetCount()); }
/// <summary> /// Deletes an instance of KLBook. Returns true on success. /// </summary> /// <param name="bookID"> bookID </param> /// <returns>bool</returns> public static bool Delete( int bookID) { return(DBKLBook.Delete( bookID)); }