private static List <KLNotify> LoadListFromReader(IDataReader reader) { List <KLNotify> kLNotifyList = new List <KLNotify>(); try { while (reader.Read()) { KLNotify kLNotify = new KLNotify(); kLNotify.notifyid = Convert.ToInt32(reader["Notifyid"]); kLNotify.userName_Action = reader["UserName_Action"].ToString(); kLNotify.authorID = Convert.ToInt32(reader["AuthorID"]); kLNotify.notifyType = reader["NotifyType"].ToString(); kLNotify.notify = reader["Notify"].ToString(); kLNotify.notifyLink = reader["NotifyLink"].ToString(); kLNotify.viewed = Convert.ToBoolean(reader["viewed"]); kLNotify.dateCreate = Convert.ToDateTime(reader["DateCreate"]); kLNotifyList.Add(kLNotify); } } finally { reader.Close(); } return(kLNotifyList); }
/// <summary> /// Compares 2 instances of KLNotify. /// </summary> public static int CompareByDateCreate(KLNotify kLNotify1, KLNotify kLNotify2) { return(kLNotify1.DateCreate.CompareTo(kLNotify2.DateCreate)); }
/// <summary> /// Compares 2 instances of KLNotify. /// </summary> public static int CompareByNotifyLink(KLNotify kLNotify1, KLNotify kLNotify2) { return(kLNotify1.NotifyLink.CompareTo(kLNotify2.NotifyLink)); }
/// <summary> /// Compares 2 instances of KLNotify. /// </summary> public static int CompareByNotify(KLNotify kLNotify1, KLNotify kLNotify2) { return(kLNotify1.Notify.CompareTo(kLNotify2.Notify)); }
/// <summary> /// Compares 2 instances of KLNotify. /// </summary> public static int CompareByNotifyType(KLNotify kLNotify1, KLNotify kLNotify2) { return(kLNotify1.NotifyType.CompareTo(kLNotify2.NotifyType)); }
/// <summary> /// Compares 2 instances of KLNotify. /// </summary> public static int CompareByAuthorID(KLNotify kLNotify1, KLNotify kLNotify2) { return(kLNotify1.AuthorID.CompareTo(kLNotify2.AuthorID)); }
/// <summary> /// Compares 2 instances of KLNotify. /// </summary> public static int CompareByUserName_Action(KLNotify kLNotify1, KLNotify kLNotify2) { return(kLNotify1.UserName_Action.CompareTo(kLNotify2.UserName_Action)); }