public void removeStd(string username, ref courseDatabase crsDB) { student std = getStudent(username); // Increment the number of seats available for each course the student has registered for List <course> registeredCrsLst = std.registeredCrs; foreach (course registeredCrs in registeredCrsLst) { foreach (course crs in crsDB.getCourseList()) { if (registeredCrs.crsID == crs.crsID) { crs.disenrollUser(std); break; } } } // Remove the student from the advisees list of his advisor faculty advisor = getFaculty(std.advisor); advisor.removeAdvisee(username); // Remove the student from the database stdLst.Remove(std); }
public void changeAdvisor(string stdName, string facName) { // Change the student's advisor student std = getStudent(stdName); string curAdvisor = std.advisor; std.setAdvisor(facName); // Add the student to the new faulty's advisee list faculty fac = getFaculty(facName); fac.addAdvisee(std); // Remove the student from the previous faculty's advisee list fac = getFaculty(curAdvisor); fac.removeAdvisee(stdName); }