Ejemplo n.º 1
0
  public String removeEntity(int id) {

    officeAdministratorService.deleteFlight(id);
    list = null;
    FacesMessage msg = new FacesMessage("Flight removed");

    FacesContext.getCurrentInstance().addMessage(null, msg);

    return null;
  }
Ejemplo n.º 2
0
  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;
  }
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
0
 public List<Flights> getList() {
   if (list == null) list = officeAdministratorService.findAll();
   return list;
 }