Ejemplo n.º 1
0
  public Reingresos() {
    // setTitle("Reingreso");
    add(
        new BitmapField(
            Bitmap.getBitmapResource("img/titulos/reingreso.png"), BitmapField.HCENTER));
    usuario = usuarios.getUsuario();

    // JGF: en caso de requerirse deshabilitar GPS
    if (!usuario.getHabilitaD().equals("1")) {
      GPSScreen.StopMessure();
      GPSScreen.CancelTimer();
      GPSScreen.PrintMessage("GPS deshabilitado!");
    }

    lblTipoDoc =
        new mkpyLabelLabelField(
            "Tipo doc:",
            usuario.getIdTipoDoc(),
            ObjectChoiceField.FIELD_RIGHT,
            Color.BLACK,
            Color.WHITE);

    add(txtCodConsultora);
    txtCodConsultora.setChangeListener(this);
    txtCodConsultora.setFocusListener(this);
    add(lblTipoDoc);
    if (usuario.getIdPais().equals("7")) { // PR
      txtNroDoc =
          new mkpyLabelEditField(
              "Nro doc:",
              "",
              9,
              EditField.FIELD_LEFT | EditField.NO_NEWLINE | EditField.FILTER_NUMERIC,
              Color.BLACK,
              Color.WHITE);
    }
    if (usuario.getIdPais().equals("8")) { // DOM
      txtNroDoc =
          new mkpyLabelEditField(
              "Nro doc:",
              "",
              11,
              EditField.FIELD_LEFT | EditField.NO_NEWLINE | EditField.FILTER_NUMERIC,
              Color.BLACK,
              Color.WHITE);
    }
    add(txtNroDoc);
    txtNroDoc.setChangeListener(this);
    txtNroDoc.setFocusListener(this);
    add(txtAppaterno);
    txtAppaterno.setChangeListener(this);
    txtAppaterno.setFocusListener(this);
    add(txtApmaterno);
    txtApmaterno.setChangeListener(this);
    txtApmaterno.setFocusListener(this);
    add(txtNombres);
    txtNombres.setChangeListener(this);
    txtNombres.setFocusListener(this);
    add(txtTelefonoCasa);
    txtTelefonoCasa.setChangeListener(this);
    txtTelefonoCasa.setFocusListener(this);
    add(txtTelefonoCelular);
    txtTelefonoCelular.setChangeListener(this);
    txtTelefonoCelular.setFocusListener(this);

    if (usuario.getHabilitaC().equals("1")) {
      add(lblRecord);
      add(txtFechaRec);
      txtFechaRec.setChangeListener(this);
      txtFechaRec.setFocusListener(this);

      add(txtObsRec);
      txtObsRec.setChangeListener(this);
      txtObsRec.setFocusListener(this);
    }

    add(btnGrabar);
    btnGrabar.setChangeListener(this);
    setStatus(lblEstado);
  }