return null;
}
try {
if (this.admin == true) {
Administrator administrator = new Administrator();
administrator.setName(this.employee.getName());
administrator.setCpf(this.employee.getCpf());
administrator.setEmail(this.employee.getEmail());
administrator.setPassword(this.employee.getPassword());
administrator.setSecondName(this.employee.getSecondName());
administrator.setUser(this.employee.getUser());
// Removendo o funcionário para termos certeza que será cadastrado como admin.
facade.removeEmployee(this.employee);
// Persistindo como Administrador.
facade.saveAdmin(administrator);
} else {
if (employee instanceof Administrator) {
Administrator admin = (Administrator) this.employee;
facade.removeAdmin(admin);
Employee emp = new Employee();
emp.setName(this.employee.getName());
emp.setCpf(this.employee.getCpf());
emp.setEmail(this.employee.getEmail());