public static List <KLNews> GetPageByAuthor(int pageNumber, int pageSize, out int totalPages, int AuthorID, string keyword, bool isdraft, bool isapproved, bool all) { totalPages = 1; IDataReader reader = DBKLNews.GetPageByAuthor(pageNumber, pageSize, out totalPages, AuthorID, keyword, isdraft, isapproved, all); return(LoadListFromReader(reader)); }
private void GetKLNewsByMNewID( int kLNewID) { using (IDataReader reader = DBKLNews.GetOnebyNewID( kLNewID)) { if (reader.Read()) { this.kLNewID = Convert.ToInt32(reader["KLNewID"]); this.newsID = Convert.ToInt32(reader["NewsID"]); this.authorID = Convert.ToInt32(reader["AuthorID"]); this.viewCount = Convert.ToInt32(reader["ViewCount"]); this.shareCount = Convert.ToInt32(reader["ShareCount"]); this.commentCount = Convert.ToInt32(reader["CommentCount"]); this.likeCount = Convert.ToInt32(reader["LikeCount"]); this.approvedBy = reader["ApprovedBy"].ToString(); this.newType = Convert.ToInt32(reader["NewType"]); this.newlsevel = Convert.ToInt32(reader["Newlsevel"]); this.newstotalpoint = Convert.ToInt32(reader["Newstotalpoint"]); this.isdraft = Convert.ToBoolean(reader["Isdraft"]); this.isapproved = Convert.ToBoolean(reader["Isapproved"]); // //this.title = Convert.ToString(reader["KLTitle"]); //this.fullContent = Convert.ToString(reader["KLFullContent"]); //this.briefContent = Convert.ToString(reader["KLBriefContent"]); //this.isDeleted = Convert.ToBoolean(reader["KLIsDeleted"]); //this.isPublish = Convert.ToBoolean(reader["KLIsPublished"]); } } }
/// <summary> /// Gets an IList with page of instances of KLNew. /// </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 <KLNews> GetPage(int pageNumber, int pageSize, out int totalPages) { totalPages = 1; IDataReader reader = DBKLNews.GetPage(pageNumber, pageSize, out totalPages); return(LoadListFromReader(reader)); }
/// <summary> /// Updates this instance of KLNew. Returns true on success. /// </summary> /// <returns>bool</returns> private bool Update() { return(DBKLNews.Update( this.kLNewID, this.newsID, this.authorID, this.viewCount, this.shareCount, this.commentCount, this.likeCount, this.approvedBy, this.newType, this.newlsevel, this.newstotalpoint, this.isdraft, this.isapproved)); }
/// <summary> /// Persists a new instance of KLNews. Returns true on success. /// </summary> /// <returns></returns> private bool Create() { int newID = 0; newID = DBKLNews.Create( this.newsID, this.authorID, this.viewCount, this.shareCount, this.commentCount, this.likeCount, this.approvedBy, this.newType, this.newlsevel, this.newstotalpoint, this.isdraft, this.isapproved); this.kLNewID = newID; return(newID > 0); }
/// <summary> /// Gets an IList with all instances of KLNew. /// </summary> public static List <KLNews> GetAll() { IDataReader reader = DBKLNews.GetAll(); return(LoadListFromReader(reader)); }
/// <summary> /// Gets a count of KLNews. /// </summary> public static int GetCount() { return(DBKLNews.GetCount()); }
/// <summary> /// Deletes an instance of KLNew. Returns true on success. /// </summary> /// <param name="kLNewID"> kLNewID </param> /// <returns>bool</returns> public static bool Delete( int kLNewID) { return(DBKLNews.Delete( kLNewID)); }