private static void LoadClassrooms(Schedule schedule, SQLiteCommand command) { command.CommandText = "select * from classrooms"; SQLiteDataReader reader = command.ExecuteReader(); while (reader.Read()) { var classroom = new Classroom {Name = (string) reader["name"], Address = (string) reader["address"]}; schedule.Classrooms.Add(classroom); } reader.Close(); }
public void AddClassroom(Classroom classroom) { Classrooms.Add(classroom); }
protected bool Equals(Classroom other) { return string.Equals(_address, other._address); }
public sClassroom(Classroom classroom) : base(classroom) { Address = classroom.Address; }
protected bool Equals(Classroom other) { return(string.Equals(_address, other._address)); }
public void RemoveClassroom(Classroom classroom) { Classrooms.Remove(classroom); foreach (var classRecord in ClassRecords) { if (classRecord.Classroom == classroom) { classRecord.Classroom = null; } } }