예제 #1
0
파일: KLBook.cs 프로젝트: sang-nm/kinhluan
        /// <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));
        }
예제 #2
0
파일: KLBook.cs 프로젝트: sang-nm/kinhluan
        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));
        }
예제 #3
0
파일: KLBook.cs 프로젝트: sang-nm/kinhluan
 /// <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));
 }
예제 #4
0
파일: KLBook.cs 프로젝트: sang-nm/kinhluan
        /// <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);
        }
예제 #5
0
파일: KLBook.cs 프로젝트: sang-nm/kinhluan
 /// <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"]);
         }
     }
 }
예제 #6
0
파일: KLBook.cs 프로젝트: sang-nm/kinhluan
        /// <summary>
        /// Gets an IList with all instances of KLBook.
        /// </summary>
        public static List <KLBook> GetAll()
        {
            IDataReader reader = DBKLBook.GetAll();

            return(LoadListFromReader(reader));
        }
예제 #7
0
파일: KLBook.cs 프로젝트: sang-nm/kinhluan
 /// <summary>
 /// Gets a count of KLBook.
 /// </summary>
 public static int GetCount()
 {
     return(DBKLBook.GetCount());
 }
예제 #8
0
파일: KLBook.cs 프로젝트: sang-nm/kinhluan
 /// <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));
 }