Esempio n. 1
0
  @Override
  protected Poliza doInsert() {
    final PolizaFormModel model = new PolizaFormModel();
    model.getPoliza().setClase("GENERICA");
    final PolizaForm form = new PolizaForm(model);

    form.open();
    if (!form.hasBeenCanceled()) {
      Poliza res = model.getPoliza();
      return getPolizasManager().salvarPoliza(res);
    }
    return super.doInsert();
  }
Esempio n. 2
0
  @Override
  protected Poliza doEdit(Poliza bean) {

    final Poliza source = getPolizasManager().getPolizaDao().get(bean.getId());
    final PolizaFormModel model = new PolizaFormModel(source);
    final PolizaForm form = new PolizaForm(model);
    form.open();
    if (!form.hasBeenCanceled()) {
      Poliza res = model.getPoliza();
      return getPolizasManager().salvarPoliza(res);
    }
    return source;
  }