Esempio n. 1
0
        private static List <KLAuthor> LoadListFromReader(IDataReader reader)
        {
            List <KLAuthor> kLAuthorList = new List <KLAuthor>();

            try
            {
                while (reader.Read())
                {
                    KLAuthor kLAuthor = new KLAuthor();
                    kLAuthor.authorID      = Convert.ToInt32(reader["AuthorID"]);
                    kLAuthor.userID        = Convert.ToInt32(reader["UserID"]);
                    kLAuthor.name          = reader["Name"].ToString();
                    kLAuthor.avatar        = reader["Avatar"].ToString();
                    kLAuthor.levelAuthor   = reader["LevelAuthor"].ToString();
                    kLAuthor.linkFacebook  = reader["LinkFacebook"].ToString();
                    kLAuthor.linkTwitter   = reader["LinkTwitter"].ToString();
                    kLAuthor.linkPinterest = reader["LinkPinterest"].ToString();
                    kLAuthor.linkInstagram = reader["LinkInstagram"].ToString();
                    kLAuthor.joinDate      = Convert.ToDateTime(reader["JoinDate"]);
                    kLAuthor.articleCount  = Convert.ToInt32(reader["ArticleCount"]);
                    kLAuthor.isDel         = Convert.ToBoolean(reader["IsDel"]);
                    kLAuthor.isActive      = Convert.ToBoolean(reader["IsActive"]);
                    kLAuthorList.Add(kLAuthor);
                }
            }
            finally
            {
                reader.Close();
            }

            return(kLAuthorList);
        }
Esempio n. 2
0
 /// <summary>
 /// Compares 2 instances of KLAuthor.
 /// </summary>
 public static int CompareByArticleCount(KLAuthor kLAuthor1, KLAuthor kLAuthor2)
 {
     return(kLAuthor1.ArticleCount.CompareTo(kLAuthor2.ArticleCount));
 }
Esempio n. 3
0
 /// <summary>
 /// Compares 2 instances of KLAuthor.
 /// </summary>
 public static int CompareByJoinDate(KLAuthor kLAuthor1, KLAuthor kLAuthor2)
 {
     return(kLAuthor1.JoinDate.CompareTo(kLAuthor2.JoinDate));
 }
Esempio n. 4
0
 /// <summary>
 /// Compares 2 instances of KLAuthor.
 /// </summary>
 public static int CompareByLinkInstagram(KLAuthor kLAuthor1, KLAuthor kLAuthor2)
 {
     return(kLAuthor1.LinkInstagram.CompareTo(kLAuthor2.LinkInstagram));
 }
Esempio n. 5
0
 /// <summary>
 /// Compares 2 instances of KLAuthor.
 /// </summary>
 public static int CompareByLinkPinterest(KLAuthor kLAuthor1, KLAuthor kLAuthor2)
 {
     return(kLAuthor1.LinkPinterest.CompareTo(kLAuthor2.LinkPinterest));
 }
Esempio n. 6
0
 /// <summary>
 /// Compares 2 instances of KLAuthor.
 /// </summary>
 public static int CompareByLinkTwitter(KLAuthor kLAuthor1, KLAuthor kLAuthor2)
 {
     return(kLAuthor1.LinkTwitter.CompareTo(kLAuthor2.LinkTwitter));
 }
Esempio n. 7
0
 /// <summary>
 /// Compares 2 instances of KLAuthor.
 /// </summary>
 public static int CompareByLinkFacebook(KLAuthor kLAuthor1, KLAuthor kLAuthor2)
 {
     return(kLAuthor1.LinkFacebook.CompareTo(kLAuthor2.LinkFacebook));
 }
Esempio n. 8
0
 /// <summary>
 /// Compares 2 instances of KLAuthor.
 /// </summary>
 public static int CompareByLevelAuthor(KLAuthor kLAuthor1, KLAuthor kLAuthor2)
 {
     return(kLAuthor1.LevelAuthor.CompareTo(kLAuthor2.LevelAuthor));
 }
Esempio n. 9
0
 /// <summary>
 /// Compares 2 instances of KLAuthor.
 /// </summary>
 public static int CompareByAvatar(KLAuthor kLAuthor1, KLAuthor kLAuthor2)
 {
     return(kLAuthor1.Avatar.CompareTo(kLAuthor2.Avatar));
 }
Esempio n. 10
0
 /// <summary>
 /// Compares 2 instances of KLAuthor.
 /// </summary>
 public static int CompareByName(KLAuthor kLAuthor1, KLAuthor kLAuthor2)
 {
     return(kLAuthor1.Name.CompareTo(kLAuthor2.Name));
 }
Esempio n. 11
0
 /// <summary>
 /// Compares 2 instances of KLAuthor.
 /// </summary>
 public static int CompareByUserID(KLAuthor kLAuthor1, KLAuthor kLAuthor2)
 {
     return(kLAuthor1.UserID.CompareTo(kLAuthor2.UserID));
 }