}
if(hasErrors()){
return INPUT;
}
AttributeSet attributeSet;
if(getAttributeSet().getId() == null || "".equalsIgnoreCase(getAttributeSet().getId())){
attributeSet = new AttributeSet();
logInfo = new LogInformation();
logInfo.setCreateBy(sessionCredentials.getCurrentUser().getId());
logInfo.setCreateDate(new Timestamp(System.currentTimeMillis()));
} else {
attributeSet = (AttributeSet) manager.getById(AttributeSet.class, getAttributeSet().getId());
logInfo = attributeSet.getLogInformation();
}
logInfo.setActiveFlag(getActive());
logInfo.setLastUpdateBy(sessionCredentials.getCurrentUser().getId());
logInfo.setLastUpdateDate(new Timestamp(System.currentTimeMillis()));
attributeSet.setLogInformation(logInfo);
attributeSet.setName(getAttributeSet().getName());
attributeSet.setDescription(getAttributeSet().getDescription());
attributeSet.setLot(getAttributeSet().getLot());
attributeSet.setInstanceAttribute(getAttributeSet().getInstanceAttribute());
attributeSet.setMandatoryLot(getAttributeSet().getMandatoryLot());
attributeSet.setLotControl(getLotControl());
attributeSet.setLotCharStartOverwrite(getAttributeSet().getLotCharStartOverwrite());
attributeSet.setLotCharEndOverwrite(getAttributeSet().getLotCharEndOverwrite());
attributeSet.setSerialNo(getAttributeSet().getSerialNo());
attributeSet.setMandatorySerialNo(getAttributeSet().getMandatorySerialNo());
attributeSet.setSerialNoControl(getSerialNoControl());
attributeSet.setSerialNoCharStartOverwrite(getAttributeSet().getSerialNoCharStartOverwrite());
attributeSet.setSerialNoCharEndOverwrite(getAttributeSet().getSerialNoCharEndOverwrite());
attributeSet.setGuaranteeDate(getAttributeSet().getGuaranteeDate());
attributeSet.setMandatoryGuaranteeDate(getAttributeSet().getMandatoryGuaranteeDate());
attributeSet.setMandatoryType(getAttributeSet().getMandatoryType());
manager.save(attributeSet);
setAttributeSet(attributeSet);
return SUCCESS;
}