}
if(hasErrors()){
return INPUT;
}
FreightCategory freightCategory;
if(getFreightCategory().getId() == null || "".equalsIgnoreCase(getFreightCategory().getId())){
freightCategory = new FreightCategory();
logInfo = new LogInformation();
logInfo.setCreateBy(sessionCredentials.getCurrentUser().getId());
logInfo.setCreateDate(new Timestamp(System.currentTimeMillis()));
msg = "Successfully Add "+getFreightCategory().getName();
} else {
freightCategory = (FreightCategory) manager.getById(FreightCategory.class, getFreightCategory().getId());
logInfo = freightCategory.getLogInformation();
msg = "Successfully Edit "+getFreightCategory().getName();
}
logInfo.setActiveFlag(getActive());
logInfo.setLastUpdateBy(sessionCredentials.getCurrentUser().getId());
logInfo.setLastUpdateDate(new Timestamp(System.currentTimeMillis()));
freightCategory.setLogInformation(logInfo);
freightCategory.setSearchKey(getFreightCategory().getSearchKey());
freightCategory.setName(getFreightCategory().getName());
freightCategory.setDescription(getFreightCategory().getDescription());
freightCategory.setCommentsHelp(getFreightCategory().getCommentsHelp());
manager.save(freightCategory);
setFreightCategory(freightCategory);
return SUCCESS;