public String execute(){
if(getTaxCategory().getName() == null || "".equalsIgnoreCase(getTaxCategory().getName())){
addActionError("Name is required");
}
TaxCategory taxCategory;
if(getTaxCategory().getId() == null || "".equalsIgnoreCase(getTaxCategory().getId())){
taxCategory = new TaxCategory();
logInfo = new LogInformation();
logInfo.setCreateBy(sessionCredentials.getCurrentUser().getId());
logInfo.setCreateDate(new Timestamp(System.currentTimeMillis()));
} else {
taxCategory = (TaxCategory) manager.getById(TaxCategory.class, getTaxCategory().getId());
logInfo = taxCategory.getLogInformation();
}
logInfo.setActiveFlag(getActive());
logInfo.setLastUpdateBy(sessionCredentials.getCurrentUser().getId());
logInfo.setLastUpdateDate(new Timestamp(System.currentTimeMillis()));
taxCategory.setLogInformation(logInfo);
taxCategory.setName(getTaxCategory().getName());
taxCategory.setDescription(getTaxCategory().getDescription());
taxCategory.setPdefault(getTaxCategory().getPdefault());
taxCategory.setCommodityCode(getTaxCategory().getCommodityCode());
manager.save(taxCategory);
setTaxCategory(taxCategory);
return SUCCESS;
}