use of com.netsteadfast.greenstep.base.exception.ServiceException in project bamboobsc by billchen198318.
the class SystemCalendarNoteSaveOrUpdateAction method save.
/**
* 儲存 TB_SYS_CALENDAR_NOTE
*
* @throws ControllerException
* @throws AuthorityException
* @throws ServiceException
* @throws Exception
*/
private void save() throws ControllerException, AuthorityException, ServiceException, Exception {
this.checkFields();
String accountOid = this.getFields().get("accountOid");
SysCalendarNoteVO sysCalendarNote = new SysCalendarNoteVO();
sysCalendarNote = this.transformFields2ValueObject(sysCalendarNote, new String[] { "title", "note", "date", "time", "contact" });
sysCalendarNote.setAlert(YesNo.NO);
if ("true".equals(this.getFields().get("alert"))) {
sysCalendarNote.setAlert(YesNo.YES);
}
DefaultResult<SysCalendarNoteVO> result = this.systemCalendarNoteLogicService.create(sysCalendarNote, accountOid);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
this.message = result.getSystemMessage().getValue();
this.success = IS_YES;
}
use of com.netsteadfast.greenstep.base.exception.ServiceException in project bamboobsc by billchen198318.
the class SystemCalendarNoteSaveOrUpdateAction method delete.
/**
* 刪除 TB_SYS_CALENDAR_NOTE
*
* @throws ControllerException
* @throws AuthorityException
* @throws ServiceException
* @throws Exception
*/
private void delete() throws ControllerException, AuthorityException, ServiceException, Exception {
SysCalendarNoteVO sysCalendarNote = new SysCalendarNoteVO();
sysCalendarNote = this.transformFields2ValueObject(sysCalendarNote, new String[] { "oid" });
DefaultResult<Boolean> result = this.sysCalendarNoteService.deleteObject(sysCalendarNote);
if (result.getValue() == null || !result.getValue()) {
throw new ServiceException(result.getSystemMessage().getValue());
}
this.message = result.getSystemMessage().getValue();
this.success = IS_YES;
}
use of com.netsteadfast.greenstep.base.exception.ServiceException in project bamboobsc by billchen198318.
the class SystemContextBeanManagmentAction method loadSysCtxBeanData.
private void loadSysCtxBeanData() throws ServiceException, Exception {
this.transformFields2ValueObject(sysCtxBean, new String[] { "oid" });
DefaultResult<SysCtxBeanVO> result = this.sysCtxBeanService.findObjectByOid(sysCtxBean);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
this.sysCtxBean = result.getValue();
SysVO sys = new SysVO();
sys.setSysId(this.sysCtxBean.getSystem());
DefaultResult<SysVO> sResult = this.sysService.findByUK(sys);
if (sResult.getValue() != null) {
this.selectValue = sResult.getValue().getOid();
}
}
use of com.netsteadfast.greenstep.base.exception.ServiceException in project bamboobsc by billchen198318.
the class SystemBpmnResourceSaveOrUpdateAction method export.
private void export() throws ControllerException, AuthorityException, ServiceException, Exception {
SysBpmnResourceVO resource = new SysBpmnResourceVO();
resource.setOid(this.getFields().get("oid"));
DefaultResult<SysBpmnResourceVO> result = this.sysBpmnResourceService.findObjectByOid(resource);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
resource = result.getValue();
sysBpmnResourceService.hibernateSessionClear();
this.uploadOid = UploadSupportUtils.create(Constants.getSystem(), UploadTypes.IS_TEMP, false, resource.getContent(), resource.getId() + ".zip");
this.message = SysMessageUtil.get(GreenStepSysMsgConstants.INSERT_SUCCESS);
this.success = IS_YES;
}
use of com.netsteadfast.greenstep.base.exception.ServiceException in project bamboobsc by billchen198318.
the class SystemBeanHelpManagementAction method loadSysBeanHelpData.
private void loadSysBeanHelpData() throws ServiceException, Exception {
this.transformFields2ValueObject(this.sysBeanHelp, new String[] { "oid" });
DefaultResult<SysBeanHelpVO> result = this.sysBeanHelpService.findObjectByOid(sysBeanHelp);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
this.sysBeanHelp = result.getValue();
SysVO sys = new SysVO();
sys.setSysId(this.sysBeanHelp.getSystem());
DefaultResult<SysVO> sResult = this.sysService.findByUK(sys);
if (sResult.getValue() != null) {
this.selectValue = sResult.getValue().getOid();
}
}
Aggregations