Example #1
0
 @Override
 public void persist() {
   if (getNewPosition() != null) {
     try {
       positionSessionBean.update(getNewPosition());
       if (!getPositions().contains(getNewPosition())) {
         getPositions().add(getNewPosition());
       }
     } catch (Exception e) {
       FacesContext.getCurrentInstance().addMessage("msg", new FacesMessage(e.getMessage()));
       throw new Error(e.getLocalizedMessage());
     }
     init();
   }
 }
Example #2
0
 @Override
 public void verify() {
   if (getCurrentPosition() != null) {
     try {
       getCurrentPosition().setStatus("V");
       getCurrentPosition().setCfmuser(userManagedBean.getUserid());
       getCurrentPosition().setCfmdate(userManagedBean.getDate());
       positionSessionBean.update(getCurrentPosition());
     } catch (Exception e) {
       FacesContext.getCurrentInstance().addMessage("msg", new FacesMessage(e.getMessage()));
       throw new Error(e.getLocalizedMessage());
     }
     // init();
   }
 }
Example #3
0
 @Override
 public void delete(Position entity) {
   if (entity != null) {
     try {
       positionSessionBean.delete(entity);
       if (getPositions().contains(entity)) {
         getPositions().remove(entity);
       }
     } catch (Exception e) {
       FacesContext.getCurrentInstance().addMessage("msg", new FacesMessage(e.getMessage()));
       throw new Error(e.getLocalizedMessage());
     }
     init();
   } else {
     FacesContext.getCurrentInstance().addMessage("msg", new FacesMessage("没有选中任何资料!"));
   }
 }
Example #4
0
 @Override
 public List<Position> retrieve() {
   return positionSessionBean.retrieve();
 }