コード例 #1
0
ファイル: KLNewsComment.cs プロジェクト: sang-nm/kinhluan
        /// <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));
        }
コード例 #2
0
ファイル: KLNewsComment.cs プロジェクト: sang-nm/kinhluan
        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));
        }
コード例 #3
0
ファイル: KLNewsComment.cs プロジェクト: sang-nm/kinhluan
 /// <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));
 }
コード例 #4
0
ファイル: KLNewsComment.cs プロジェクト: sang-nm/kinhluan
        /// <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);
        }
コード例 #5
0
ファイル: KLNewsComment.cs プロジェクト: sang-nm/kinhluan
 /// <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"]);
         }
     }
 }
コード例 #6
0
ファイル: KLNewsComment.cs プロジェクト: sang-nm/kinhluan
        /// <summary>
        /// Gets an IList with all instances of KLNewsComment.
        /// </summary>
        public static List <KLNewsComment> GetAll()
        {
            IDataReader reader = DBKLNewsComment.GetAll();

            return(LoadListFromReader(reader));
        }
コード例 #7
0
ファイル: KLNewsComment.cs プロジェクト: sang-nm/kinhluan
 public static int GetCountByNewsID(int newsid)
 {
     return(DBKLNewsComment.GetCountByNewsID(newsid));
 }
コード例 #8
0
ファイル: KLNewsComment.cs プロジェクト: sang-nm/kinhluan
 /// <summary>
 /// Gets a count of KLNewsComment.
 /// </summary>
 public static int GetCount()
 {
     return(DBKLNewsComment.GetCount());
 }
コード例 #9
0
ファイル: KLNewsComment.cs プロジェクト: sang-nm/kinhluan
 /// <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));
 }