}
if(hasErrors()){
return INPUT;
}
AssetGroup assetGroup;
if(getAssetGroup().getId() == null || "".equalsIgnoreCase(getAssetGroup().getId())){
assetGroup = new AssetGroup();
logInfo = new LogInformation();
logInfo.setCreateBy(sessionCredentials.getCurrentUser().getId());
logInfo.setCreateDate(new Timestamp(System.currentTimeMillis()));
msg = "Successfully Add "+getAssetGroup().getName();
} else {
assetGroup = (AssetGroup) manager.getById(AssetGroup.class, getAssetGroup().getId());
logInfo = assetGroup.getLogInformation();
msg = "Successfully Edit "+getAssetGroup().getName();
}
logInfo.setActiveFlag(getActive());
logInfo.setLastUpdateBy(sessionCredentials.getCurrentUser().getId());
logInfo.setLastUpdateDate(new Timestamp(System.currentTimeMillis()));
assetGroup.setLogInformation(logInfo);
assetGroup.setName(getAssetGroup().getName());
assetGroup.setDescription(getAssetGroup().getDescription());
assetGroup.setCommentHelp(getAssetGroup().getCommentHelp());
assetGroup.setOwned(getAssetGroup().getOwned());
assetGroup.setDepreciated(getAssetGroup().getDepreciated());
assetGroup.setOneAssetPerUOM(getAssetGroup().getOneAssetPerUOM());
assetGroup.setCreateAsActive(getAssetGroup().getCreateAsActive());
manager.save(assetGroup);
setAssetGroup(assetGroup);
return SUCCESS;
}