public String removeEntity(int id) { officeAdministratorService.deleteFlight(id); list = null; FacesMessage msg = new FacesMessage("Flight removed"); FacesContext.getCurrentInstance().addMessage(null, msg); return null; }
public String onEdit(RowEditEvent event) { System.out.println("eeeee"); officeAdministratorService.updateFlight( ((Flights) event.getObject()).getId(), ((Flights) event.getObject()).getNumberFlight(), ((Flights) event.getObject()).getFromFlight(), ((Flights) event.getObject()).getToFlight(), ((Flights) event.getObject()).getFromDate(), ((Flights) event.getObject()).getToDate(), ((Flights) event.getObject()).getCount(), ((Flights) event.getObject()).getPrice()); list = null; FacesMessage msg = new FacesMessage("Flight edited"); FacesContext.getCurrentInstance().addMessage(null, msg); return null; }
public String onAdd() { officeAdministratorService.createFlight( numberFlight, fromFlight, toFlight, new Timestamp(fromDate.getTime()), new Timestamp(toDate.getTime()), count, price); numberFlight = ""; fromFlight = ""; toFlight = ""; fromDate = null; toDate = null; count = 0; price = 0; list = null; FacesMessage msg = new FacesMessage("Flight added"); FacesContext.getCurrentInstance().addMessage(null, msg); return null; }
public List<Flights> getList() { if (list == null) list = officeAdministratorService.findAll(); return list; }