Exemplo n.º 1
0
        /// <summary>
        /// Gets an IList with page of instances of KLNewsComment.
        /// </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 <KLNewsComment> GetPage(int pageNumber, int pageSize, out int totalPages)
        {
            totalPages = 1;
            IDataReader reader = DBKLNewsComment.GetPage(pageNumber, pageSize, out totalPages);

            return(LoadListFromReader(reader));
        }
Exemplo n.º 2
0
        public static List <KLNewsComment> GetPageByAuthor(int pageNumber, int pageSize, out int totalPages, int authorid, int isapproved, int newsid, int newtype, int parent)
        {
            totalPages = 1;
            IDataReader reader = DBKLNewsComment.GetPageByAuthor(pageNumber, pageSize, out totalPages, authorid, isapproved, newsid, newtype, parent);

            return(LoadListFromReader(reader));
        }
Exemplo n.º 3
0
 /// <summary>
 /// Updates this instance of KLNewsComment. Returns true on success.
 /// </summary>
 /// <returns>bool</returns>
 private bool Update()
 {
     return(DBKLNewsComment.Update(
                this.commentID,
                this.commentParentID,
                this.newsID,
                this.userID,
                this.name,
                this.title,
                this.email,
                this.createDate,
                this.phone,
                this.comment,
                this.isPublish,
                this.iSDel));
 }
Exemplo n.º 4
0
        /// <summary>
        /// Persists a new instance of KLNewsComment. Returns true on success.
        /// </summary>
        /// <returns></returns>
        private bool Create()
        {
            int newID = 0;

            newID = DBKLNewsComment.Create(
                this.commentParentID,
                this.newsID,
                this.userID,
                this.name,
                this.title,
                this.email,
                this.createDate,
                this.phone,
                this.comment,
                this.isPublish,
                this.iSDel);

            this.commentID = newID;

            return(newID > 0);
        }
Exemplo n.º 5
0
 /// <summary>
 /// Gets an instance of KLNewsComment.
 /// </summary>
 /// <param name="commentID"> commentID </param>
 private void GetKLNewsComment(
     int commentID)
 {
     using (IDataReader reader = DBKLNewsComment.GetOne(
                commentID))
     {
         if (reader.Read())
         {
             this.commentID       = Convert.ToInt32(reader["CommentID"]);
             this.commentParentID = Convert.ToInt32(reader["CommentParentID"]);
             this.newsID          = Convert.ToInt32(reader["NewsID"]);
             this.userID          = Convert.ToInt32(reader["UserID"]);
             this.name            = reader["Name"].ToString();
             this.title           = reader["Title"].ToString();
             this.email           = reader["Email"].ToString();
             this.createDate      = Convert.ToDateTime(reader["CreateDate"]);
             this.phone           = reader["Phone"].ToString();
             this.comment         = reader["Comment"].ToString();
             this.isPublish       = Convert.ToBoolean(reader["IsPublish"]);
             this.iSDel           = Convert.ToBoolean(reader["ISDel"]);
         }
     }
 }
Exemplo n.º 6
0
        /// <summary>
        /// Gets an IList with all instances of KLNewsComment.
        /// </summary>
        public static List <KLNewsComment> GetAll()
        {
            IDataReader reader = DBKLNewsComment.GetAll();

            return(LoadListFromReader(reader));
        }
Exemplo n.º 7
0
 public static int GetCountByNewsID(int newsid)
 {
     return(DBKLNewsComment.GetCountByNewsID(newsid));
 }
Exemplo n.º 8
0
 /// <summary>
 /// Gets a count of KLNewsComment.
 /// </summary>
 public static int GetCount()
 {
     return(DBKLNewsComment.GetCount());
 }
Exemplo n.º 9
0
 /// <summary>
 /// Deletes an instance of KLNewsComment. Returns true on success.
 /// </summary>
 /// <param name="commentID"> commentID </param>
 /// <returns>bool</returns>
 public static bool Delete(
     int commentID)
 {
     return(DBKLNewsComment.Delete(
                commentID));
 }