コード例 #1
0
ファイル: JobBean.java プロジェクト: launchpadmcjeff/funhouse
 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
ファイル: JobBean.java プロジェクト: launchpadmcjeff/funhouse
 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();
 }