/// <summary> /// Returns the Lectures that teach a Module /// </summary> /// <param name="module">The Module that the Lecturers teach</param> /// <returns>LinkedList of lecturer</returns> public LinkedList loadLectuerList(Module module) { LinkedList lectureList = new LinkedList(); Lecturer newLec; string sqlStatment = "SELECT ID, Lec_Name, Initials, Email, MaxHours, MaxConsecHours, MinSlotsPerDays, SlotsOff, Deleted"; sqlStatment += "FROM Lecturer, Lecturer/Module WHERE Lecturer/Module.Module_ID LIKE " + module.getID(); try { OpenConection(); cmd = new OleDbCommand(sqlStatment, conn); reader = cmd.ExecuteReader(); while (reader.Read()) { if (reader["Deleted"].ToString().Equals("False")) { newLec = new Lecturer(); newLec.setId(reader["ID"].ToString()); newLec.setName(reader["Lec_Name"].ToString()); newLec.setInitials(reader["Initials"].ToString()); newLec.setEmail(reader["Email"].ToString()); newLec.setMaxHours(Convert.ToInt32(reader["MaxHours"])); newLec.setMaxConsecHours(Convert.ToInt32(reader["MaxConsecHours"])); newLec.setMinSlotsPerDay(Convert.ToInt32(reader["MinSlotsPerDays"])); newLec.setSlotsOff(reader["SlotsOff"].ToString()); lectureList.addAtTail(newLec); } } CloseConnection(); } catch { // MessageBox.Show("Failed to get data from source"); } return lectureList; }