コード例 #1
0
ファイル: KLNew.cs プロジェクト: sang-nm/kinhluan
        private static List <KLNews> LoadListFromReader(IDataReader reader)
        {
            List <KLNews> KLNewList = new List <KLNews>();

            try
            {
                while (reader.Read())
                {
                    KLNews KLNew = new KLNews();
                    KLNew.kLNewID        = Convert.ToInt32(reader["KLNewID"]);
                    KLNew.newsID         = Convert.ToInt32(reader["NewsID"]);
                    KLNew.authorID       = Convert.ToInt32(reader["AuthorID"]);
                    KLNew.viewCount      = Convert.ToInt32(reader["ViewCount"]);
                    KLNew.shareCount     = Convert.ToInt32(reader["ShareCount"]);
                    KLNew.commentCount   = Convert.ToInt32(reader["CommentCount"]);
                    KLNew.likeCount      = Convert.ToInt32(reader["LikeCount"]);
                    KLNew.approvedBy     = reader["ApprovedBy"].ToString();
                    KLNew.newType        = Convert.ToInt32(reader["NewType"]);
                    KLNew.newlsevel      = Convert.ToInt32(reader["Newlsevel"]);
                    KLNew.newstotalpoint = Convert.ToInt32(reader["Newstotalpoint"]);
                    KLNew.isdraft        = Convert.ToBoolean(reader["Isdraft"]);
                    //
                    try
                    {
                        KLNew.isapproved    = Convert.ToBoolean(reader["Isapproved"]);
                        KLNew.Datepost      = Convert.ToDateTime(reader["StartDate"]);
                        KLNew.title         = Convert.ToString(reader["KLTitle"]);
                        KLNew.newapprovedBy = Convert.ToString(reader["NewsApprovedBy"]);
                    }
                    catch (Exception)
                    {
                    }
                    KLNewList.Add(KLNew);
                }
            }
            finally
            {
                reader.Close();
            }

            return(KLNewList);
        }
コード例 #2
0
ファイル: KLNew.cs プロジェクト: sang-nm/kinhluan
 /// <summary>
 /// Compares 2 instances of KLNew.
 /// </summary>
 public static int CompareByNewstotalpoint(KLNews kLNew1, KLNews kLNew2)
 {
     return(kLNew1.Newstotalpoint.CompareTo(kLNew2.Newstotalpoint));
 }
コード例 #3
0
ファイル: KLNew.cs プロジェクト: sang-nm/kinhluan
 /// <summary>
 /// Compares 2 instances of KLNew.
 /// </summary>
 public static int CompareByNewlsevel(KLNews kLNew1, KLNews kLNew2)
 {
     return(kLNew1.Newlsevel.CompareTo(kLNew2.Newlsevel));
 }
コード例 #4
0
ファイル: KLNew.cs プロジェクト: sang-nm/kinhluan
 /// <summary>
 /// Compares 2 instances of KLNew.
 /// </summary>
 public static int CompareByNewType(KLNews kLNew1, KLNews kLNew2)
 {
     return(kLNew1.NewType.CompareTo(kLNew2.NewType));
 }
コード例 #5
0
ファイル: KLNew.cs プロジェクト: sang-nm/kinhluan
 /// <summary>
 /// Compares 2 instances of KLNew.
 /// </summary>
 public static int CompareByApprovedBy(KLNews kLNew1, KLNews kLNew2)
 {
     return(kLNew1.ApprovedBy.CompareTo(kLNew2.ApprovedBy));
 }
コード例 #6
0
ファイル: KLNew.cs プロジェクト: sang-nm/kinhluan
 /// <summary>
 /// Compares 2 instances of KLNew.
 /// </summary>
 public static int CompareByLikeCount(KLNews kLNew1, KLNews kLNew2)
 {
     return(kLNew1.LikeCount.CompareTo(kLNew2.LikeCount));
 }
コード例 #7
0
ファイル: KLNew.cs プロジェクト: sang-nm/kinhluan
 /// <summary>
 /// Compares 2 instances of KLNew.
 /// </summary>
 public static int CompareByCommentCount(KLNews kLNew1, KLNews kLNew2)
 {
     return(kLNew1.CommentCount.CompareTo(kLNew2.CommentCount));
 }
コード例 #8
0
ファイル: KLNew.cs プロジェクト: sang-nm/kinhluan
 /// <summary>
 /// Compares 2 instances of KLNew.
 /// </summary>
 public static int CompareByViewCount(KLNews kLNew1, KLNews kLNew2)
 {
     return(kLNew1.ViewCount.CompareTo(kLNew2.ViewCount));
 }
コード例 #9
0
ファイル: KLNew.cs プロジェクト: sang-nm/kinhluan
 /// <summary>
 /// Compares 2 instances of KLNew.
 /// </summary>
 public static int CompareByAuthorID(KLNews kLNew1, KLNews kLNew2)
 {
     return(kLNew1.AuthorID.CompareTo(kLNew2.AuthorID));
 }
コード例 #10
0
ファイル: KLNew.cs プロジェクト: sang-nm/kinhluan
 /// <summary>
 /// Compares 2 instances of KLNew.
 /// </summary>
 public static int CompareByNewsID(KLNews kLNew1, KLNews kLNew2)
 {
     return(kLNew1.NewsID.CompareTo(kLNew2.NewsID));
 }