Exemple #1
0
        private static List <KLBook> LoadListFromReader(IDataReader reader)
        {
            List <KLBook> KLBookList = new List <KLBook>();

            try
            {
                while (reader.Read())
                {
                    KLBook KLBook = new KLBook();
                    KLBook.bookID      = Convert.ToInt32(reader["BookID"]);
                    KLBook.authorID    = Convert.ToInt32(reader["AuthorID"]);
                    KLBook.title       = reader["Title"].ToString();
                    KLBook.image       = reader["Image"].ToString();
                    KLBook.url         = reader["Url"].ToString();
                    KLBook.description = reader["Description"].ToString();
                    KLBook.isPublish   = Convert.ToBoolean(reader["IsPublish"]);
                    KLBook.isDelected  = Convert.ToBoolean(reader["IsDelected"]);
                    KLBookList.Add(KLBook);
                }
            }
            finally
            {
                reader.Close();
            }

            return(KLBookList);
        }
Exemple #2
0
 /// <summary>
 /// Compares 2 instances of KLBook.
 /// </summary>
 public static int CompareByDescription(KLBook KLBook1, KLBook KLBook2)
 {
     return(KLBook1.Description.CompareTo(KLBook2.Description));
 }
Exemple #3
0
 /// <summary>
 /// Compares 2 instances of KLBook.
 /// </summary>
 public static int CompareByUrl(KLBook KLBook1, KLBook KLBook2)
 {
     return(KLBook1.Url.CompareTo(KLBook2.Url));
 }
Exemple #4
0
 /// <summary>
 /// Compares 2 instances of KLBook.
 /// </summary>
 public static int CompareByImage(KLBook KLBook1, KLBook KLBook2)
 {
     return(KLBook1.Image.CompareTo(KLBook2.Image));
 }
Exemple #5
0
 /// <summary>
 /// Compares 2 instances of KLBook.
 /// </summary>
 public static int CompareByTitle(KLBook KLBook1, KLBook KLBook2)
 {
     return(KLBook1.Title.CompareTo(KLBook2.Title));
 }
Exemple #6
0
 /// <summary>
 /// Compares 2 instances of KLBook.
 /// </summary>
 public static int CompareByAuthorID(KLBook KLBook1, KLBook KLBook2)
 {
     return(KLBook1.AuthorID.CompareTo(KLBook2.AuthorID));
 }
Exemple #7
0
 /// <summary>
 /// Compares 2 instances of KLBook.
 /// </summary>
 public static int CompareByBookID(KLBook KLBook1, KLBook KLBook2)
 {
     return(KLBook1.BookID.CompareTo(KLBook2.BookID));
 }