Example #1
0
  public static boolean delete(String db, BigliettoTreno biglietto) throws Exception {
    boolean ok = false;
    ArrayList params = new ArrayList();

    String cod = biglietto.getCodice();

    if (cod != null && !cod.equals("")) {
      params.add(cod);
      Query.delete(DELETE_BIGLIETTO_TRENO, params, db);
    }
    return ok;
  }
Example #2
0
  public static boolean update(String db, BigliettoTreno biglietto) throws Exception {
    boolean ok = false;
    ArrayList params = new ArrayList();

    params.add(biglietto.getTrasferimento());
    params.add(biglietto.getPasseggero().getCodicePartecipante());
    params.add(biglietto.getClasse().getCodice());
    params.add(biglietto.getTariffa().toDouble());
    params.add(biglietto.getCodice());

    ok = Query.insert(UPDATE_BIGLIETTO_TRENO, params, db);

    return ok;
  }