private static List <KLLevel> LoadListFromReader(IDataReader reader) { List <KLLevel> kLLevelList = new List <KLLevel>(); try { while (reader.Read()) { KLLevel kLLevel = new KLLevel(); kLLevel.levelID = Convert.ToInt32(reader["LevelID"]); kLLevel.name = reader["Name"].ToString(); kLLevel.from = Convert.ToInt32(reader["From"]); kLLevel.to = reader["To"].ToString(); kLLevelList.Add(kLLevel); } } finally { reader.Close(); } return(kLLevelList); }
/// <summary> /// Compares 2 instances of KLLevel. /// </summary> public static int CompareByTo(KLLevel kLLevel1, KLLevel kLLevel2) { return(kLLevel1.To.CompareTo(kLLevel2.To)); }
/// <summary> /// Compares 2 instances of KLLevel. /// </summary> public static int CompareByFrom(KLLevel kLLevel1, KLLevel kLLevel2) { return(kLLevel1.From.CompareTo(kLLevel2.From)); }
/// <summary> /// Compares 2 instances of KLLevel. /// </summary> public static int CompareByName(KLLevel kLLevel1, KLLevel kLLevel2) { return(kLLevel1.Name.CompareTo(kLLevel2.Name)); }
/// <summary> /// Compares 2 instances of KLLevel. /// </summary> public static int CompareByLevelID(KLLevel kLLevel1, KLLevel kLLevel2) { return(kLLevel1.LevelID.CompareTo(kLLevel2.LevelID)); }