Пример #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);
        }
Пример #2
0
        public static KLAuthor GetKLAuthorByUserID(
            int UserID)
        {
            KLAuthor author = new KLAuthor();

            using (IDataReader reader = DBKLAuthor.GetOneByUserID(
                       UserID))
            {
                if (reader.Read())
                {
                    author.authorID      = Convert.ToInt32(reader["AuthorID"]);
                    author.userID        = Convert.ToInt32(reader["UserID"]);
                    author.name          = reader["Name"].ToString();
                    author.avatar        = reader["Avatar"].ToString();
                    author.levelAuthor   = reader["LevelAuthor"].ToString();
                    author.linkFacebook  = reader["LinkFacebook"].ToString();
                    author.linkTwitter   = reader["LinkTwitter"].ToString();
                    author.linkPinterest = reader["LinkPinterest"].ToString();
                    author.linkInstagram = reader["LinkInstagram"].ToString();
                    author.joinDate      = Convert.ToDateTime(reader["JoinDate"]);
                    author.articleCount  = Convert.ToInt32(reader["ArticleCount"]);
                    author.isDel         = Convert.ToBoolean(reader["IsDel"]);
                    author.isActive      = Convert.ToBoolean(reader["IsActive"]);
                }
            }
            return(author);
        }
Пример #3
0
 /// <summary>
 /// Compares 2 instances of KLAuthor.
 /// </summary>
 public static int CompareByArticleCount(KLAuthor kLAuthor1, KLAuthor kLAuthor2)
 {
     return(kLAuthor1.ArticleCount.CompareTo(kLAuthor2.ArticleCount));
 }
Пример #4
0
 /// <summary>
 /// Compares 2 instances of KLAuthor.
 /// </summary>
 public static int CompareByJoinDate(KLAuthor kLAuthor1, KLAuthor kLAuthor2)
 {
     return(kLAuthor1.JoinDate.CompareTo(kLAuthor2.JoinDate));
 }
Пример #5
0
 /// <summary>
 /// Compares 2 instances of KLAuthor.
 /// </summary>
 public static int CompareByLinkInstagram(KLAuthor kLAuthor1, KLAuthor kLAuthor2)
 {
     return(kLAuthor1.LinkInstagram.CompareTo(kLAuthor2.LinkInstagram));
 }
Пример #6
0
 /// <summary>
 /// Compares 2 instances of KLAuthor.
 /// </summary>
 public static int CompareByLinkPinterest(KLAuthor kLAuthor1, KLAuthor kLAuthor2)
 {
     return(kLAuthor1.LinkPinterest.CompareTo(kLAuthor2.LinkPinterest));
 }
Пример #7
0
 /// <summary>
 /// Compares 2 instances of KLAuthor.
 /// </summary>
 public static int CompareByLinkTwitter(KLAuthor kLAuthor1, KLAuthor kLAuthor2)
 {
     return(kLAuthor1.LinkTwitter.CompareTo(kLAuthor2.LinkTwitter));
 }
Пример #8
0
 /// <summary>
 /// Compares 2 instances of KLAuthor.
 /// </summary>
 public static int CompareByLinkFacebook(KLAuthor kLAuthor1, KLAuthor kLAuthor2)
 {
     return(kLAuthor1.LinkFacebook.CompareTo(kLAuthor2.LinkFacebook));
 }
Пример #9
0
 /// <summary>
 /// Compares 2 instances of KLAuthor.
 /// </summary>
 public static int CompareByLevelAuthor(KLAuthor kLAuthor1, KLAuthor kLAuthor2)
 {
     return(kLAuthor1.LevelAuthor.CompareTo(kLAuthor2.LevelAuthor));
 }
Пример #10
0
 /// <summary>
 /// Compares 2 instances of KLAuthor.
 /// </summary>
 public static int CompareByAvatar(KLAuthor kLAuthor1, KLAuthor kLAuthor2)
 {
     return(kLAuthor1.Avatar.CompareTo(kLAuthor2.Avatar));
 }
Пример #11
0
 /// <summary>
 /// Compares 2 instances of KLAuthor.
 /// </summary>
 public static int CompareByName(KLAuthor kLAuthor1, KLAuthor kLAuthor2)
 {
     return(kLAuthor1.Name.CompareTo(kLAuthor2.Name));
 }
Пример #12
0
 /// <summary>
 /// Compares 2 instances of KLAuthor.
 /// </summary>
 public static int CompareByUserID(KLAuthor kLAuthor1, KLAuthor kLAuthor2)
 {
     return(kLAuthor1.UserID.CompareTo(kLAuthor2.UserID));
 }