Пример #1
0
        private static List <KLGratitude> LoadListFromReader(IDataReader reader)
        {
            List <KLGratitude> kLGratitudeList = new List <KLGratitude>();

            try
            {
                while (reader.Read())
                {
                    KLGratitude kLGratitude = new KLGratitude();
                    kLGratitude.guestID   = Convert.ToInt32(reader["GuestID"]);
                    kLGratitude.name      = reader["Name"].ToString();
                    kLGratitude.avatar    = reader["Avatar"].ToString();
                    kLGratitude.authorID  = Convert.ToInt32(reader["AuthorID"]);
                    kLGratitude.createUtc = Convert.ToDateTime(reader["CreateUtc"]);
                    kLGratitude.comment   = reader["Comment"].ToString();
                    kLGratitudeList.Add(kLGratitude);
                }
            }
            finally
            {
                reader.Close();
            }

            return(kLGratitudeList);
        }
Пример #2
0
 /// <summary>
 /// Compares 2 instances of KLGratitude.
 /// </summary>
 public static int CompareByComment(KLGratitude kLGratitude1, KLGratitude kLGratitude2)
 {
     return(kLGratitude1.Comment.CompareTo(kLGratitude2.Comment));
 }
Пример #3
0
 /// <summary>
 /// Compares 2 instances of KLGratitude.
 /// </summary>
 public static int CompareByCreateUtc(KLGratitude kLGratitude1, KLGratitude kLGratitude2)
 {
     return(kLGratitude1.CreateUtc.CompareTo(kLGratitude2.CreateUtc));
 }
Пример #4
0
 /// <summary>
 /// Compares 2 instances of KLGratitude.
 /// </summary>
 public static int CompareByAuthorID(KLGratitude kLGratitude1, KLGratitude kLGratitude2)
 {
     return(kLGratitude1.AuthorID.CompareTo(kLGratitude2.AuthorID));
 }
Пример #5
0
 /// <summary>
 /// Compares 2 instances of KLGratitude.
 /// </summary>
 public static int CompareByAvatar(KLGratitude kLGratitude1, KLGratitude kLGratitude2)
 {
     return(kLGratitude1.Avatar.CompareTo(kLGratitude2.Avatar));
 }
Пример #6
0
 /// <summary>
 /// Compares 2 instances of KLGratitude.
 /// </summary>
 public static int CompareByName(KLGratitude kLGratitude1, KLGratitude kLGratitude2)
 {
     return(kLGratitude1.Name.CompareTo(kLGratitude2.Name));
 }
Пример #7
0
 /// <summary>
 /// Compares 2 instances of KLGratitude.
 /// </summary>
 public static int CompareByGuestID(KLGratitude kLGratitude1, KLGratitude kLGratitude2)
 {
     return(kLGratitude1.GuestID.CompareTo(kLGratitude2.GuestID));
 }