예제 #1
0
 @Override
 public void delete() {
   try {
     bc.delete(getId());
     addMessageContext("Registro deletado com sucesso!", SeverityType.INFO);
   } catch (Exception e) {
     addMessageContext("Ocorreu um erro ao deletar o registro!", SeverityType.ERROR);
   }
   redirectListView();
 }
예제 #2
0
 @Override
 public void save() {
   try {
     bc.validateAndSave(getBean());
     addMessageContext("Registro salvo com sucesso!", SeverityType.INFO);
   } catch (BusinessException ex) {
     addMessageContext(ex.getMessage(), SeverityType.WARN);
   } catch (Exception ex) {
     addMessageContext(ex.getMessage(), SeverityType.ERROR);
   }
 }
예제 #3
0
 @Override
 public void deleteSelection() {
   try {
     boolean delete;
     for (Iterator<String> iter = getSelection().keySet().iterator(); iter.hasNext(); ) {
       String id = iter.next();
       delete = getSelection().get(id);
       if (delete) {
         bc.delete(id);
         iter.remove();
       }
     }
     addMessageContext("Registro deletado com sucesso!", SeverityType.INFO);
     redirectListView();
   } catch (Exception e) {
     addMessageContext("Ocorreu um erro ao deletar o registro!", SeverityType.ERROR);
   }
 }
예제 #4
0
 @Override
 protected Level handleLoad(String id) {
   return bc.load(id);
 }
예제 #5
0
 @Override
 protected List<Level> handleResultList() {
   return bc.findAll();
 }