|
|
@ -1,2 +1,59 @@ |
|
|
|
package org.example;public class Administration { |
|
|
|
package org.example; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
public class Administration { |
|
|
|
private List<Professor> professors; |
|
|
|
private List<Admin> admins; |
|
|
|
|
|
|
|
public Administration() |
|
|
|
{ |
|
|
|
this.professors = new ArrayList<>(); |
|
|
|
this.admins = new ArrayList<>(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public boolean deleteProfessor(String professorID) |
|
|
|
{ |
|
|
|
for(Professor professor : professors) |
|
|
|
{ |
|
|
|
if(professor.getProfessorID().equals(professorID)){ |
|
|
|
professors.remove(professor); |
|
|
|
return true; //Course found and removed |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
} |
|
|
|
public void addProfessor(Professor professor) |
|
|
|
{ |
|
|
|
professors.add(professor); |
|
|
|
} |
|
|
|
|
|
|
|
public boolean deleteAdmin(String AdminID) |
|
|
|
{ |
|
|
|
for(Admin admin : admins ) |
|
|
|
{ |
|
|
|
if(admin.getId().equals(AdminID)){ |
|
|
|
admins.remove(admin); |
|
|
|
return true; //Course found and removed |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
public void addAdmin(Admin admin) |
|
|
|
{ |
|
|
|
admins.add(admin); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|