public void saveSenha() { try { Integer idFun = serviceSession.getFuncionarioIdSession(); try { Funcionario oldFunc = service.findById(idFun); if (!SecurityUtils.md5(this.funcionarioSenha.getSenha()).equals(oldFunc.getSenha())) { FacesUtils.errorI18n("app.entity.funcionario.error.invalidPassword"); return; } if (!this.funcionarioSenha .getValidNovaSenha() .equals(this.funcionarioSenha.getNovaSenha())) { FacesUtils.errorI18n("app.entity.funcionario.error.invalidNewPassword"); return; } } catch (ApplicationMessageException e) { FacesUtils.error(e.getMessage()); } this.service.save(this.funcionarioSenha); this.init(); FacesUtils.infoI18n("app.generic.successSave"); } catch (BusinessMessageException e) { FacesUtils.info(e.getMessage()); } catch (ApplicationMessageException e) { FacesUtils.error(e.getMessage()); } }
public void delete() { try { this.service.delete(this.funcionario); this.init(); } catch (BusinessMessageException e) { FacesUtils.info(e.getMessage()); } catch (ApplicationMessageException e) { FacesUtils.error(e.getMessage()); } }
public void save() { try { this.funcionario.setNome(this.funcionario.getNome()); this.service.save(this.funcionario); this.init(); FacesUtils.infoI18n("app.generic.successSave"); } catch (BusinessMessageException e) { FacesUtils.info(e.getMessage()); } catch (ApplicationMessageException e) { FacesUtils.error(e.getMessage()); } }