/// <summary> /// Returns a list of Departments /// </summary> /// <param name="institute">The Institute the Departments are in</param> /// <returns>A LinkedList of Departments</returns> public LinkedList loadDepartmentList(Institute institute) { LinkedList deptList = new LinkedList(); Department tempDept ; string sqlStatment = "SELECT * FROM Department"; try { OpenConection(); cmd = new OleDbCommand(sqlStatment, conn); reader = cmd.ExecuteReader(); while (reader.Read()) { if (reader["Deleted"].ToString().Equals("False")) { tempDept = new Department(); tempDept.setId(reader["ID"].ToString()); tempDept.setName(reader["Dept_Name"].ToString()); tempDept.setLecturerList(loadLectuerList(tempDept)); tempDept.setCourseList(loadCourseList(tempDept)); deptList.addAtTail("tempDept"); } } CloseConnection(); } catch { } return deptList; }