コード例 #1
0
 public void mostrarBotones(boolean bol) {
   botonera.getChildren().get(1).setVisible(!bol);
   botonera.getChildren().get(2).setVisible(bol);
   botonera.getChildren().get(6).setVisible(false);
   botonera.getChildren().get(8).setVisible(false);
   botonera.getChildren().get(0).setVisible(bol);
   botonera.getChildren().get(3).setVisible(!bol);
   botonera.getChildren().get(5).setVisible(!bol);
   botonera.getChildren().get(4).setVisible(false);
 }
コード例 #2
0
  @Override
  public void inicializar() throws IOException {
    HashMap<String, Object> mapa =
        (HashMap<String, Object>) Sessions.getCurrent().getAttribute("mapaGeneral");
    if (mapa != null) {
      if (mapa.get("tabsGenerales") != null) {
        tabs = (List<Tab>) mapa.get("tabsGenerales");
        nombre = (String) mapa.get("titulo");
        mapa.clear();
        mapa = null;
      }
    }
    actualizar();
    Botonera botonera =
        new Botonera() {

          @Override
          public void salir() {
            cerrarVentana(divGrupoInspectores, nombre, tabs);
          }

          @Override
          public void limpiar() {}

          @Override
          public void guardar() {
            if (validar()) {
              String nombre = txtGrupo.getValue();
              GrupoInspectores grupo = new GrupoInspectores();
              grupo.setId(1);
              grupo.setGrupo(nombre);
              servicioGrupoInspectores.guardar(grupo);
              msj.mensajeInformacion(Mensaje.guardado);
              actualizar();
            }
          }

          @Override
          public void eliminar() {}
        };

    botonera.getChildren().get(1).setVisible(false);
    botoneraGrupoInspectores.appendChild(botonera);
  }
コード例 #3
0
  @Override
  public void inicializar() throws IOException {
    HashMap<String, Object> mapa =
        (HashMap<String, Object>) Sessions.getCurrent().getAttribute("mapaGeneral");
    if (mapa != null) {
      if (mapa.get("tabsGenerales") != null) {
        tabs = (List<Tab>) mapa.get("tabsGenerales");
        nombre = (String) mapa.get("titulo");
        mapa.clear();
        mapa = null;
      }
    }
    Botonera botonera =
        new Botonera() {

          @Override
          public void salir() {
            cerrarVentana(divEvaluar, nombre, tabs);
          }

          @Override
          public void limpiar() {
            lblCedula.setValue("");
            lblCodigo.setValue("");
            lblDescripcion.setValue("");
            lblFicha.setValue("");
            lblNombre.setValue("");
            lblTipo.setValue("");
            dtbFecha.setValue(null);
            codigoInforme = null;
            ltbAcciones.getItems().clear();
            ltbAccionesInspector.getItems().clear();
            lblOrdenamientos.setValue("");
            lblFuncionario.setValue("");
            lblFechaVisita.setValue("");
          }

          @Override
          public void guardar() {
            if (codigoInforme == null) Mensaje.mensajeError(Mensaje.camposVacios);
            else {
              ltbAcciones.renderAll();
              ltbAccionesInspector.renderAll();
              if (validarLista() && validarLista2()) {
                List<PlanAccion> planes = new ArrayList<PlanAccion>();
                if (ltbAcciones.getItemCount() != 0) {
                  for (int i = 0; i < ltbAcciones.getItemCount(); i++) {
                    Listitem listItem = ltbAcciones.getItemAtIndex(i);
                    PlanAccion plan = listItem.getValue();
                    if (listItem.isSelected()) {
                      Textbox text = (Textbox) listItem.getChildren().get(6).getChildren().get(0);
                      String observacion = text.getValue();
                      Datebox date = (Datebox) listItem.getChildren().get(5).getChildren().get(0);
                      Date fecha = date.getValue();
                      plan.setEstado("Finalizado");
                      plan.setObservacion(observacion);
                      plan.setFechaCumplido(new Timestamp(fecha.getTime()));
                    } else {
                      plan.setEstado("Programado");
                      plan.setObservacion(null);
                      plan.setFechaCumplido(null);
                    }
                    plan.setFechaAuditoria(fechaHora);
                    plan.setHoraAuditoria(horaAuditoria);
                    plan.setUsuarioAuditoria(nombreUsuarioSesion());
                    planes.add(plan);
                  }
                  servicioPlanAccion.guardarVarios(planes);
                }

                List<PlanAccion> planes2 = new ArrayList<PlanAccion>();
                if (ltbAccionesInspector.getItemCount() != 0) {
                  for (int i = 0; i < ltbAccionesInspector.getItemCount(); i++) {
                    Listitem listItem = ltbAccionesInspector.getItemAtIndex(i);
                    PlanAccion plan = listItem.getValue();
                    if (listItem.isSelected()) {
                      Textbox text = (Textbox) listItem.getChildren().get(6).getChildren().get(0);
                      String observacion = text.getValue();
                      Datebox date = (Datebox) listItem.getChildren().get(5).getChildren().get(0);
                      Date fecha = date.getValue();
                      plan.setEstado("Finalizado");
                      plan.setObservacion(observacion);
                      plan.setFechaCumplido(new Timestamp(fecha.getTime()));
                    } else {
                      plan.setEstado("Programado");
                      plan.setObservacion(null);
                      plan.setFechaCumplido(null);
                    }
                    plan.setFechaAuditoria(fechaHora);
                    plan.setHoraAuditoria(horaAuditoria);
                    plan.setUsuarioAuditoria(nombreUsuarioSesion());
                    planes2.add(plan);
                  }
                  servicioPlanAccion.guardarVarios(planes2);
                }
                Mensaje.mensajeInformacion(Mensaje.guardado);
                limpiar();
              } else
                Mensaje.mensajeError(
                    "Debe indicar la fecha en que se cumplieron las Acciones "
                        + "que ha seleccionado como cumplidas");
            }
          }

          @Override
          public void eliminar() {}
        };
    botonera.getChildren().get(1).setVisible(false);
    botoneraEvaluar.appendChild(botonera);
  }
コード例 #4
0
  @Override
  public void inicializar() throws IOException {
    HashMap<String, Object> map =
        (HashMap<String, Object>) Sessions.getCurrent().getAttribute("mapaGeneral");
    if (map != null) {
      if (map.get("tabsGenerales") != null) {
        tabs = (List<Tab>) map.get("tabsGenerales");
        titulo = (String) map.get("titulo");
        map.clear();
        map = null;
      }
    }
    txtSYF0005.setFocus(true);
    mostrarCatalogo();

    botonera =
        new Botonera() {

          @Override
          public void seleccionar() {
            if (validarSeleccion()) {
              if (catalogo.obtenerSeleccionados().size() == 1) {
                mostrarBotones(false);
                F0005 f05 = catalogo.objetoSeleccionadoDelCatalogo();
                clave = f05.getId();
                abrirRegistro();
                F0004 f04 = servicioF0004.buscar(f05.getId().getDrsy(), f05.getId().getDrrt());
                txtRTF0005.setValue(f05.getId().getDrrt());
                txtRTF0005.setDisabled(true);
                txtSYF0005.setValue(f05.getId().getDrsy());
                txtSYF0005.setDisabled(true);
                txtKYF0005.setValue(f05.getId().getDrky());
                txtKYF0005.setDisabled(true);
                txtDL01F0005.setValue(f05.getDrdl01());
                txtSPHDF0005.setValue(f05.getDrsphd());
                txtHRDCF0005.setValue(f05.getDrhrdc());
                txtDL02F0005.setValue(f05.getDrdl02());
                lblDescripcionF0004.setValue(f04.getDtdl01());
                txtDL01F0005.setFocus(true);
              } else msj.mensajeAlerta(Mensaje.editarSoloUno);
            }
          }

          @Override
          public void salir() {
            cerrarVentana(divVF0005, titulo, tabs);
          }

          @Override
          public void reporte() {}

          @Override
          public void limpiar() {
            clave = null;
            mostrarBotones(false);
            limpiarCampos();
            habilitarTextClave();
          }

          @Override
          public void guardar() {
            boolean guardar = true;
            if (clave == null && (claveSYExiste() || claveRTExiste())) guardar = false;
            else guardar = validar();

            if (guardar) {
              String rt = txtRTF0005.getValue();
              String sy = txtSYF0005.getValue();
              String ky = txtKYF0005.getValue();
              String dl01 = txtDL01F0005.getValue();
              String sphd = txtSPHDF0005.getValue();
              String dl02 = txtDL02F0005.getValue();
              String hrdc = txtHRDCF0005.getValue();
              F0005PK clave = new F0005PK();
              clave.setDrrt(rt);
              clave.setDrsy(sy);
              clave.setDrky(ky);
              F0005 fooo5 = new F0005();
              fooo5.setId(clave);
              fooo5.setDrdl01(dl01);
              fooo5.setDrdl02(dl02);
              fooo5.setDrhrdc(hrdc);
              fooo5.setDrsphd(sphd);
              fooo5.setDruser("user");
              // fooo5.setDrupmj(""); //Fecha
              fooo5.setDrupmt(Double.parseDouble(horaAuditoria));
              servicioF0005.guardar(fooo5);
              msj.mensajeInformacion(Mensaje.guardado);
              limpiar();
              listaGeneral = servicioF0005.buscarTodosOrdenados();
              catalogo.actualizarLista(listaGeneral);
            }
          }

          @Override
          public void eliminar() {}

          @Override
          public void buscar() {

            abrirCatalogo();
          }

          @Override
          public void ayuda() {}

          @Override
          public void annadir() {
            abrirRegistro();
            mostrarBotones(false);
          }
        };
    botonera.getChildren().get(6).setVisible(false);
    botonera.getChildren().get(8).setVisible(false);
    botonera.getChildren().get(1).setVisible(false);
    botonera.getChildren().get(3).setVisible(false);
    botonera.getChildren().get(5).setVisible(false);
    botonera.getChildren().get(4).setVisible(false);
    botoneraF0005.appendChild(botonera);
  }