}
if(hasErrors()){
return INPUT;
}
SerialNoControl serialNoControl;
if(getSerialNoControl().getId() == null || "".equalsIgnoreCase(getSerialNoControl().getId())){
serialNoControl = new SerialNoControl();
logInfo = new LogInformation();
logInfo.setCreateBy(sessionCredentials.getCurrentUser().getId());
logInfo.setCreateDate(new Timestamp(System.currentTimeMillis()));
} else {
serialNoControl = (SerialNoControl) manager.getById(SerialNoControl.class, getSerialNoControl().getId());
logInfo = new LogInformation();
}
logInfo.setActiveFlag(getActive());
logInfo.setLastUpdateBy(sessionCredentials.getCurrentUser().getId());
logInfo.setLastUpdateDate(new Timestamp(System.currentTimeMillis()));
serialNoControl.setLogInformation(logInfo);
serialNoControl.setName(getSerialNoControl().getName());
serialNoControl.setDescription(getSerialNoControl().getDescription());
serialNoControl.setStartNo(getSerialNoControl().getStartNo());
serialNoControl.setIncrement(getSerialNoControl().getIncrement());
serialNoControl.setCurrentNext(getSerialNoControl().getCurrentNext());
serialNoControl.setPrefix(getSerialNoControl().getPrefix());
serialNoControl.setSuffix(getSerialNoControl().getSuffix());
manager.save(serialNoControl);
setSerialNoControl(serialNoControl);
return SUCCESS;