Пример #1
0
 public void save() {
   Job saveJob = jobRepo.saveJob(job);
   if (saveJob.getId().equals(job.getId())) {
     FacesContext.getCurrentInstance()
         .addMessage("growl", new FacesMessage("Job successfully updated"));
   } else {
     FacesContext.getCurrentInstance()
         .addMessage("growl", new FacesMessage("Job successfully added"));
   }
   job = new Job();
   jobs = jobRepo.listAll();
 }
Пример #2
0
 public void delete() {
   Job deletedJob = jobRepo.deleteById(job.getId());
   if (deletedJob == null) {
     FacesContext.getCurrentInstance().addMessage("growl", new FacesMessage("Job not deleted"));
   } else {
     FacesContext.getCurrentInstance()
         .addMessage("growl", new FacesMessage("Job successfully deleted"));
   }
   job = new Job();
   jobs = jobRepo.listAll();
 }