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

            try
            {
                while (reader.Read())
                {
                    KLNewsComment kLNewsComment = new KLNewsComment();
                    kLNewsComment.commentID       = Convert.ToInt32(reader["CommentID"]);
                    kLNewsComment.commentParentID = Convert.ToInt32(reader["CommentParentID"]);
                    kLNewsComment.newsID          = Convert.ToInt32(reader["NewsID"]);
                    kLNewsComment.userID          = Convert.ToInt32(reader["UserID"]);
                    kLNewsComment.name            = reader["Name"].ToString();
                    kLNewsComment.title           = reader["Title"].ToString();
                    kLNewsComment.email           = reader["Email"].ToString();
                    kLNewsComment.createDate      = Convert.ToDateTime(reader["CreateDate"]);
                    kLNewsComment.phone           = reader["Phone"].ToString();
                    kLNewsComment.comment         = reader["Comment"].ToString();
                    kLNewsComment.isPublish       = Convert.ToBoolean(reader["IsPublish"]);
                    kLNewsComment.iSDel           = Convert.ToBoolean(reader["ISDel"]);
                    try
                    {
                        kLNewsComment.newstitle = Convert.ToString(reader["NewsTitle"]);
                    }
                    catch (Exception)
                    {
                    }
                    kLNewsCommentList.Add(kLNewsComment);
                }
            }
            finally
            {
                reader.Close();
            }

            return(kLNewsCommentList);
        }
Esempio n. 2
0
 /// <summary>
 /// Compares 2 instances of KLNewsComment.
 /// </summary>
 public static int CompareByComment(KLNewsComment kLNewsComment1, KLNewsComment kLNewsComment2)
 {
     return(kLNewsComment1.Comment.CompareTo(kLNewsComment2.Comment));
 }
Esempio n. 3
0
 /// <summary>
 /// Compares 2 instances of KLNewsComment.
 /// </summary>
 public static int CompareByPhone(KLNewsComment kLNewsComment1, KLNewsComment kLNewsComment2)
 {
     return(kLNewsComment1.Phone.CompareTo(kLNewsComment2.Phone));
 }
Esempio n. 4
0
 /// <summary>
 /// Compares 2 instances of KLNewsComment.
 /// </summary>
 public static int CompareByCreateDate(KLNewsComment kLNewsComment1, KLNewsComment kLNewsComment2)
 {
     return(kLNewsComment1.CreateDate.CompareTo(kLNewsComment2.CreateDate));
 }
Esempio n. 5
0
 /// <summary>
 /// Compares 2 instances of KLNewsComment.
 /// </summary>
 public static int CompareByEmail(KLNewsComment kLNewsComment1, KLNewsComment kLNewsComment2)
 {
     return(kLNewsComment1.Email.CompareTo(kLNewsComment2.Email));
 }
Esempio n. 6
0
 /// <summary>
 /// Compares 2 instances of KLNewsComment.
 /// </summary>
 public static int CompareByTitle(KLNewsComment kLNewsComment1, KLNewsComment kLNewsComment2)
 {
     return(kLNewsComment1.Title.CompareTo(kLNewsComment2.Title));
 }
Esempio n. 7
0
 /// <summary>
 /// Compares 2 instances of KLNewsComment.
 /// </summary>
 public static int CompareByName(KLNewsComment kLNewsComment1, KLNewsComment kLNewsComment2)
 {
     return(kLNewsComment1.Name.CompareTo(kLNewsComment2.Name));
 }
Esempio n. 8
0
 /// <summary>
 /// Compares 2 instances of KLNewsComment.
 /// </summary>
 public static int CompareByUserID(KLNewsComment kLNewsComment1, KLNewsComment kLNewsComment2)
 {
     return(kLNewsComment1.UserID.CompareTo(kLNewsComment2.UserID));
 }
Esempio n. 9
0
 /// <summary>
 /// Compares 2 instances of KLNewsComment.
 /// </summary>
 public static int CompareByCommentParentID(KLNewsComment kLNewsComment1, KLNewsComment kLNewsComment2)
 {
     return(kLNewsComment1.CommentParentID.CompareTo(kLNewsComment2.CommentParentID));
 }