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