Esempio n. 1
0
 public void excluir() {
   try {
     service.delete(user);
   } catch (PermissionException ex) {
     FacesContext.getCurrentInstance()
         .addMessage(null, new FacesMessage("Você não tem permissão para Excluir um Usuário."));
     logger.error(ex);
   } catch (ICRMException ex) {
     logger.error("Problema ao excluir um Usuário.", ex);
   }
   user = new User();
   init();
 }
Esempio n. 2
0
 public void confirmarEdicao() {
   try {
     service.update(user);
   } catch (PermissionException ex) {
     FacesContext.getCurrentInstance()
         .addMessage(null, new FacesMessage("Você não tem permissão para Editar um Usuário."));
     logger.error(ex);
   } catch (ICRMException ex) {
     logger.error("Problema ao editar um Usuário.", ex);
   }
   this.editando = false;
   user = new User();
   init();
 }
Esempio n. 3
0
 @PostConstruct
 private void init() {
   Session session =
       (Session)
           FacesContext.getCurrentInstance()
               .getELContext()
               .getELResolver()
               .getValue(FacesContext.getCurrentInstance().getELContext(), null, "accmmSession");
   if (session.getLoggedUser() != null) {
     service.setUser(session.getLoggedUser());
     try {
       users = service.findAll();
     } catch (PermissionException ex) {
       FacesContext.getCurrentInstance()
           .addMessage(
               null,
               new FacesMessage(
                   "Você não tem permissão para visualizar as informações de Usuário."));
       logger.error(ex);
     } catch (ICRMException ex) {
       logger.error("Problema ao executar PostConstruct", ex);
     }
   }
 }