public String execute(){
if(getBusinessPartner().getId() != null && !"".equalsIgnoreCase(getBusinessPartner().getId())){
setBusinessPartner((BusinessPartner) manager.getById(BusinessPartner.class, getBusinessPartner().getId()));
}
Employee employee;
if(getEmployee().getId() == null || "".equalsIgnoreCase(getEmployee().getId())){
employee = new Employee();
logInfo = new LogInformation();
logInfo.setCreateBy(sessionCredentials.getCurrentUser().getId());
logInfo.setCreateDate(new Timestamp(System.currentTimeMillis()));
} else {
employee = (Employee) manager.getById(Employee.class, getEmployee().getId());
logInfo = employee.getLogInformation();
}
logInfo.setActiveFlag(1);
logInfo.setLastUpdateBy(sessionCredentials.getCurrentUser().getId());
logInfo.setLastUpdateDate(new Timestamp(System.currentTimeMillis()));
employee.setBusinessPartner(getBusinessPartner());
employee.setIsEmployee(getEmployee().getIsEmployee());
employee.setSearchKey(getBusinessPartner().getSearchKey());
employee.setName(getBusinessPartner().getName1());
employee.setSalesRepresentative(getEmployee().getSalesRepresentative());
manager.save(employee);
setEmployee(employee);
return SUCCESS;