@Listen("onClick = button#cfgSave")
 public void cfgSaveClick(MouseEvent event) {
   if (logger.isDebugEnabled()) logger.debug(" cfgSave button event = " + event);
   try {
     Properties config = Util.getConfig(null);
     if (isValidPort(portsToScan.getText())) {
       config.setProperty(Constants.SERIAL_PORTS, portsToScan.getValue());
     } else {
       Messagebox.show(
           "Device ports to scan is invalid. In Linux (pi) '/dev/ttyUSB0,/dev/ttyUSB1,etc', in MS Windows 'COM1,COM2,COM3,etc'");
     }
     if (isValidBaudRate(portBaudRate.getValue())) {
       config.setProperty(Constants.SERIAL_PORT_BAUD, portBaudRate.getValue());
       Util.saveConfig();
     } else {
       Messagebox.show("Device baud rate (speed) must be one of 4800,9600,19200,38400,57600");
     }
     if (NumberUtils.isNumber(cfgWindOffset.getValue())) {
       config.setProperty(Constants.WIND_ZERO_OFFSET, cfgWindOffset.getValue());
       Util.saveConfig();
       // notify others
       producer.sendBody(Constants.WIND_ZERO_ADJUST_CMD + ":" + cfgWindOffset.getValue() + ",");
     } else {
       Messagebox.show("Wind offset must be numeric");
     }
     config.setProperty(Constants.PREFER_RMC, (String) useRmcGroup.getSelectedItem().getValue());
     config.setProperty(
         Constants.DNS_USE_CHOICE, (String) useHomeGroup.getSelectedItem().getValue());
     Util.saveConfig();
   } catch (Exception e) {
     logger.error(e.getMessage(), e);
   }
 }
 private void cargarDatosIniciales() {
   logger.log(Level.INFO, "[TipoAbonoMttoCtrl][cargarDatosIniciales]");
   Boolean checked;
   Boolean optTodo = Boolean.FALSE;
   Boolean optClave = Boolean.FALSE;
   try {
     if (tipoAbonoSelected != null) {
       txtDescripcionTipoAbono.setValue(tipoAbonoSelected.getDescripcionTipoAbono());
       checked =
           (accion != null && accion == Constants.ACCION_MANTTO_NEW)
               ? Boolean.TRUE
               : (tipoAbonoSelected.getEstadoRegistro() != null
                   ? tipoAbonoSelected.getEstadoRegistro()
                   : Boolean.FALSE);
       checkEstadoTipoAbono.setChecked(checked);
     }
     optTodo =
         (accion != null && accion == Constants.ACCION_MANTTO_VER) ? Boolean.TRUE : Boolean.FALSE;
     optClave =
         (accion != null && accion == Constants.ACCION_MANTTO_NEW) ? Boolean.FALSE : Boolean.TRUE;
     txtDescripcionTipoAbono.setDisabled(optTodo);
     checkEstadoTipoAbono.setDisabled(optTodo);
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
  @Listen("onClick = #btn_confirmar")
  public void alterarOperador() {
    Map<String, Object> arguments = (Map) rw_dadosOperador.getValue();
    Operador op = (Operador) arguments.get("funAlterar");
    lb_operador = (Listbox) arguments.get("lb_operador");
    String pass = tb_insira_password.getText();
    List<Operador> list =
        operadorDao.obtemPorUsername(tb_username.getText(), tb_password.getText());
    if (!list.isEmpty() && op.getId() != list.get(0).getId()) {
      Clients.showNotification(
          "Um operador ja foi cadrastado com esse username", "error", null, null, 2000);
    } else {
      if (!tb_password.getText().equals(pass)) {
        Clients.showNotification("o password deve ser igual", "error", null, null, 2000);

      } else {
        ListModelList<Operador> lista = (ListModelList) lb_operador.getModel();
        lista.remove(op);
        setValues(op);
        operadorDao.update(op);
        lista.add(0, op);
        operadorWin.detach();
        ;
        Clients.showNotification("Dados do operador " + op.getNome() + " foram alterados");
      }
    }
  }
  /**
   * Search/filter data for the filled out fields<br>
   * <br>
   * 1. Count how many textboxes are filled. <br>
   * 2. Create a map with the count entries. <br>
   * 3. Store the propertynames(must corresponds to the domain classes properties) and values to the
   * map. <br>
   * 4. Call the ServiceDAO method with the map as parameter. <br>
   */
  private void doSearchArticle() {

    // ++ create the searchObject and init sorting ++//
    // only in sample app init with all orders
    HibernateSearchObject<Article> soArticle =
        new HibernateSearchObject<Article>(Article.class, getPageSizeArticleSearch());
    soArticle.addSort("artNr", false);

    if (StringUtils.isNotEmpty(tb_OrderPosition_SearchArticlelNo.getValue())) {
      soArticle.addFilter(
          new Filter(
              "artNr", "%" + tb_OrderPosition_SearchArticlelNo.getValue() + "%", Filter.OP_ILIKE));
    }

    if (StringUtils.isNotEmpty(tb_OrderPosition_SearchArticleDesc.getValue())) {
      soArticle.addFilter(
          new Filter(
              "artKurzbezeichnung",
              "%" + tb_OrderPosition_SearchArticleDesc.getValue() + "%",
              Filter.OP_ILIKE));
    }

    // Set the ListModel.
    getPlwArticles().init(soArticle, listBoxArticleSearch, paging_ListBoxArticleSearch);
  }
  public void onCreate$detalleUsuarioWindow(Event event) throws Exception {
    doOnCreateCommon(this.detalleUsuarioWindow, event);
    MensajeMultilinea.doSetTemplate();
    if (this.args.containsKey("usuarioSelected")) {
      usuarioSelected = ((Usuarios) this.args.get("usuarioSelected"));
      setUsuarioSelected(usuarioSelected);
      if (!workspace.isAllowed("mostrar_password_user")) {
        txtClaveUsuario.setType("password");
        txtClaveUsuario2.setType("password");
      }
    } else {
      txtClaveUsuario.setType("password");
      txtClaveUsuario2.setType("password");
    }
    if (this.args.containsKey("token")) {
      this.token = ((Integer) this.args.get("token"));
      setToken(this.token);
    } else {
      setToken(Integer.valueOf(0));
    }
    if (this.args.containsKey("listaUsuariosCtrl")) {
      listaUsuarioCtrl = ((ListaUsuariosCtrl) this.args.get("listaUsuariosCtrl"));
    }

    checkPermisos();
    showDetalleCliente();
  }
 public void onClick$btnBuscar() {
   if (txtHm.getValue().isEmpty()) {
     MensajeEmergente.mostrar("NOFINDED", asignarFocusBuscar);
   } else {
     paciente = servicioPaciente.buscarUno(txtHm.getValue(), 'A');
     veterinario = usuario.getPersona().getVeterinario();
     if (paciente == null) {
       MensajeEmergente.mostrar("NOTFOUND", asignarFocusBuscar);
     } else {
       txtHm.setDisabled(true);
       txtNombrePaciente.setValue(paciente.getNombre());
       txtRaza.setValue(paciente.getRaza().getNombre());
       txtEspecie.setValue(paciente.getRaza().getEspecie().getNombre());
       txtSexo.setValue(paciente.getSexo().getNombre());
       txtNombreResponsable.setValue(
           paciente.getResponsable().getPersona().getNombre()
               + " "
               + paciente.getResponsable().getPersona().getApellido());
       txtCi.setValue(String.valueOf(paciente.getResponsable().getCedula()));
       txtEdad.setValue(HelperDateAge.age(paciente.getFechaNac(), ' '));
       visibilidadSecciones(true, true, true);
       cargar();
       actividadBotones(false, false, true, false, false, false);
     }
   }
 }
  private void cargarHistorialResultadosParaclinicos(
      Row fila, Presultados_paraclinicos presultados_paraclinicos) {
    if (presultados_paraclinicos == null) {
      fila.appendChild(Utilidades.obtenerCell("", Label.class, true, true));
      fila.appendChild(Utilidades.obtenerCell("", Label.class, true, true));
    } else {
      Pexamenes_paraclinicos pexamenes_paraclinicos = new Pexamenes_paraclinicos();
      pexamenes_paraclinicos.setCodigo_empresa(presultados_paraclinicos.getCodigo_empresa());
      pexamenes_paraclinicos.setCodigo_sucursal(presultados_paraclinicos.getCodigo_sucursal());
      pexamenes_paraclinicos.setCodigo(presultados_paraclinicos.getCodigo_examen());

      pexamenes_paraclinicos =
          zkWindow
              .getServiceLocator()
              .getPexamenes_paraclinicosService()
              .consultar(pexamenes_paraclinicos);

      fila.appendChild(
          Utilidades.obtenerCell(presultados_paraclinicos.getFecha(), Datebox.class, true, false));
      Cell celda =
          Utilidades.obtenerCell(
              presultados_paraclinicos.getResultado(), Textbox.class, true, false);
      Textbox textbox_resultado = (Textbox) celda.getFirstChild();

      textbox_resultado.setAttribute(
          "VALOR_NORMAL_ANORMAL", presultados_paraclinicos.getNormal_anormal());
      textbox_resultado.setAttribute(
          "VALOR_DESCRIPCION_NA", presultados_paraclinicos.getDescripcion_na());

      textbox_resultado.setPopup(
          generarPopupResultados(textbox_resultado, false, pexamenes_paraclinicos));
      fila.appendChild(celda);
    }
  }
  private void setConfigDefaults() {
    try {
      Properties config = Util.getConfig(null);

      for (Comboitem item : portBaudRate.getItems()) {
        if (config.getProperty(Constants.SERIAL_PORT_BAUD).equals(item.getValue())) {
          portBaudRate.setSelectedItem(item);
        }
      }
      portsToScan.setValue(config.getProperty(Constants.SERIAL_PORTS));
      cfgWindOffset.setValue(config.getProperty(Constants.WIND_ZERO_OFFSET));
      String useChoice = config.getProperty(Constants.DNS_USE_CHOICE);
      if (Constants.DNS_USE_BOAT.equals(useChoice)) {
        useHomeGroup.setSelectedItem(useBoatRadio);
      } else {
        useHomeGroup.setSelectedItem(useHomeRadio);
      }
      if (new Boolean(config.getProperty(Constants.PREFER_RMC))) {
        useRmcGroup.setSelectedItem(useRmcRadio);
      } else {
        useRmcGroup.setSelectedItem(useHdgRadio);
      }
    } catch (Exception e) {
      logger.error(e.getMessage(), e);
      Messagebox.show("There has been a problem with loading the configuration:" + e.getMessage());
    }
  }
Example #9
0
  /*
   * (non-Javadoc)
   *
   * @see com.hxzy.base.web.window.ActionWindow#onBind()
   */
  @Override
  public void onBind() {

    list = dictService.findByProperty("parent.code", "productCategory");
    binder.loadComponent(combobox);

    if (member != null) {
      companyName.setValue(member.getCompanyName());
      contacts.setValue(member.getContacts());
      joinTime.setValue(member.getJoinTime());
      endTime.setValue(member.getEndTime());

      combobox.setItemRenderer(
          new ComboitemRenderer() {

            public void render(Comboitem item, Object o) throws Exception {
              Dict d = (Dict) o;
              item.setValue(d);
              item.setLabel(d.getName());
              Dict category = member.getCategory();

              if (d.equals(category)) {
                combobox.setSelectedItem(item);
              }
            }
          });
    }
  }
 public void doActualizar() {
   // usuarioSelected.setStatus(checkEstadoUsuario.isChecked());
   usuarioSelected.setCodigoempleado(txtNumerocarne.getValue());
   usuarioSelected.setContrasena(txtClaveUsuario2.getValue());
   usuarioSelected.setNombreCompleto(txtNombreUsuario.getValue());
   usuarioSelected.setNombreusuario(txtUsuarioSistema.getValue());
   usuarioSelected.setRegistroslista(txtRegistrosLista.getValue());
   //        try {
   //            responseOperacion = usuarioBean.guardarUsuario(usuarioSelected, Boolean.FALSE);
   if (responseOperacion.getCodigoRespuesta() == Constants.CODE_OPERACION_SATISFACTORIA) {
     //                MensajeMultilinea.show("Usuario actualizado Satisfactoriamente",
     // Constants.MENSAJE_TIPO_INFO);
     //                usuarioSelected = responseOperacion.getUsuario();
     loadDataFromEntity();
     doReadOnly(Boolean.TRUE);
     doEditButton();
     listaUsuarioCtrl.refresTotalRegistros();
     listaUsuarioCtrl.refreshModel(0);
   } else {
     MensajeMultilinea.show(responseOperacion.getMensajeRespuesta(), Constants.MENSAJE_TIPO_ERROR);
   }
   //        } catch (DiservWebException bex) {
   //            bex.printStackTrace();
   //            MensajeMultilinea.show(bex.toString(), Constants.MENSAJE_TIPO_ERROR);
   //        }
   doReadOnly(Boolean.TRUE);
   doEditButton();
 }
  @Override
  protected void preencherDadosTela(KCategoriaProblema kCategoriaProblema)
      throws NucleoRegraNegocioExcecao {

    tbNome.setValue(kCategoriaProblema.getNome());
    tbDescricao.setValue(kCategoriaProblema.getDescricao());
  }
  @Override
  protected List definirTabs() {
    // Cria a nova lista
    List<NucleoTab> listaTabs = new ArrayList<NucleoTab>();

    // ////////////////////////////
    // Dados Cadastro
    // ////////////////////////////
    NucleoTab tabDadosCadastro = new NucleoTab();

    // Atribui o nome à tab
    tabDadosCadastro.setNomeTab(NucleoMensagens.getMensagem(NucleoMensagens.TERMO_DADOS_CADASTRO));

    // Atribui o conteúdo à tab
    GridDados gridDadosCadastro = new GridDados();
    tbNome.setWidth("150px");
    tbNome.setMaxlength(50);
    gridDadosCadastro.adicionarLinha(
        NucleoMensagens.getMensagem(NucleoMensagens.TERMO_NOME), tbNome);

    tbDescricao.setWidth("150px");
    tbDescricao.setMaxlength(300);
    gridDadosCadastro.adicionarLinha(
        NucleoMensagens.getMensagem(NucleoMensagens.TERMO_DESCRICAO), tbDescricao);

    tabDadosCadastro.setConteudoTab(gridDadosCadastro);
    listaTabs.add(tabDadosCadastro);

    return listaTabs;
  }
Example #13
0
 public void onClick$search() {
   this.selectGrade = gradeList.getSelectGrade();
   List tlist =
       studentService.findBydeplistAndrid(
           dlist, Role, gradeList.getSelectGrade(), nameSearch.getValue(), tnoSearch.getValue());
   leaderlist.setModel(new ListModelList(tlist));
 }
  // Metodo para guardar la informacion //
  public void guardarDatos() throws Exception {
    try {
      // log.info("ejecutando metodo guardarDatos()");
      if (validarForm()) {
        FormularioUtil.setUpperCase(groupboxEditar);
        // Cargamos los componentes //

        Maestro_manual maestro_manual = new Maestro_manual();
        maestro_manual.setId_manual(
            (lgxId_manual.getValue() != null ? lgxId_manual.getValue() : 0L));
        maestro_manual.setCodigo_empresa(codigo_empresa);
        maestro_manual.setCodigo_sucursal(codigo_sucursal);
        maestro_manual.setManual(tbxManual.getValue());
        maestro_manual.setTipo_manual(lbxTipo_manual.getSelectedItem().getValue().toString());
        maestro_manual.setTipo_moneda(lbxTipo_moneda.getSelectedItem().getValue().toString());
        maestro_manual.setCreacion_date(new Timestamp(new GregorianCalendar().getTimeInMillis()));
        maestro_manual.setCreacion_user(usuarios.getCodigo().toString());
        Map<String, Object> mapa_datos = new HashMap<String, Object>();
        mapa_datos.put("maestro_manual", maestro_manual);
        mapa_datos.put("accion", tbxAccion.getValue());
        mapa_datos.put("mapa_datos_procedimientos", mapa_datos_procedimientos);
        maestro_manualService.guardarDatos(mapa_datos);
        tbxAccion.setValue("modificar");
        mostrarDatos(maestro_manual);
        MensajesUtil.mensajeInformacion(
            "Informacion ..", "Los datos se guardaron satisfactoriamente");
      }

    } catch (Exception e) {
      MensajesUtil.mensajeError(e, "", this);
    }
  }
Example #15
0
 public void init(GhZcqc z) {
   zcqc = z;
   if (z.getZcTime() != null) {
     titlegettime.setValue(ConvertUtil.convertDate(DateUtil.getDateString(z.getZcTime())));
   }
   if (z.getZcPubtime() != null) {
     gettime.setValue(ConvertUtil.convertDate(DateUtil.getDateString(z.getZcPubtime())));
   }
   if (z.getZcNum() != null
       || z.getZcQuasym() != null
       || z.getZcPubdept() != null
       || z.getZcIdentdept() != null) {
     certifino.setValue(z.getZcNum());
     qualino.setValue(z.getZcQuasym());
     certifidept.setValue(z.getZcPubdept());
     identdept.setValue(z.getZcIdentdept());
   }
   /** 初始化附件 */
   fileList.clear();
   List<Jxkh_DataFile> list = userDetailService.getFileByUser(zcqc.getZcId(), Jxkh_DataFile.TITLE);
   if (list != null && list.size() > 0) {
     for (Jxkh_DataFile f : list) {
       if (f != null) {
         String[] s = new String[4];
         s[0] = f.getFilePath();
         s[1] = f.getFileName();
         s[2] = f.getUpTime();
         s[3] = Jxkh_DataFile.TRAIN.toString();
         fileList.add(s);
       }
     }
   }
   fileListbox.setModel(new ListModelList(fileList));
 }
Example #16
0
  /** Clears the components values. <br> */
  public void doClear() {

    // temporarely disable the validation to allow the field's clearing
    doRemoveValidation();

    rolShortdescription.setValue("");
    rolLongdescription.setValue("");
  }
 public void doClear() {
   txtClaveUsuario.setValue(null);
   txtClaveUsuario2.setValue(null);
   txtNombreUsuario.setValue(null);
   txtNumerocarne.setValue(null);
   txtRegistrosLista.setValue(null);
   txtUsuarioSistema.setValue(null);
 }
 public void doReadOnly(Boolean opt) {
   txtClaveUsuario.setReadonly(opt);
   txtClaveUsuario2.setReadonly(opt);
   txtNombreUsuario.setReadonly(opt);
   txtNumerocarne.setReadonly(opt);
   txtRegistrosLista.setReadonly(opt);
   txtUsuarioSistema.setReadonly(opt);
 }
 public void cetak() throws Exception {
   Window win =
       (Window) Executions.createComponents("/zul/admin/rpt_daftar_perusahaan.zul", null, null);
   Textbox sql = (Textbox) win.getFellow("sql");
   Kecamatan kec = (Kecamatan) cmbKecamatan.getSelectedItem().getValue();
   sql.setValue("SELECT * FROM perusahaan WHERE kecamatan_id=" + kec.getId());
   win.doModal();
 }
Example #20
0
  /** Resets the init values from mem vars. <br> */
  private void doResetInitValues() {

    artNr.setValue(oldVar_artNr);
    artKurzbezeichnung.setValue(oldVar_artKurzbezeichnung);
    aupMenge.setValue(oldVar_aupMenge);
    aupEinzelwert.setValue(oldVar_aupEinzelwert);
    aupGesamtwert.setValue(oldVar_aupGesamtwert);
  }
Example #21
0
  /** Stores the init values in mem vars. <br> */
  private void doStoreInitValues() {

    oldVar_artNr = artNr.getValue();
    oldVar_artKurzbezeichnung = artKurzbezeichnung.getValue();
    oldVar_aupMenge = aupMenge.getValue();
    oldVar_aupEinzelwert = aupEinzelwert.getValue();
    oldVar_aupGesamtwert = aupGesamtwert.getValue();
  }
Example #22
0
  /**
   * Writes the bean data to the components.<br>
   *
   * @param anOrderposition Orderposition
   */
  public void doWriteBeanToComponents(Orderposition anOrderposition) {

    artNr.setValue(anOrderposition.getArticle().getArtNr());
    artKurzbezeichnung.setValue(anOrderposition.getArticle().getArtKurzbezeichnung());
    aupMenge.setValue(anOrderposition.getAupMenge());
    aupEinzelwert.setValue(anOrderposition.getAupEinzelwert());
    aupGesamtwert.setValue(anOrderposition.getAupGesamtwert());
  }
 @Listen("onChange = #txtCodigo")
 public boolean claveExiste() {
   if (servicioAliado.existe(txtCodigo.getValue())) {
     msj.mensajeAlerta(Mensaje.claveUsada);
     txtCodigo.setFocus(true);
     return true;
   } else return false;
 }
 public void buscarInformacionPrestador(Prestadores pre) {
   if (pre.getDireccion() != null) {
     tbxDirPres.setValue(pre.getDireccion());
   }
   if (pre.getTel_oficina() != null || pre.getTel_res() != null) {
     tbxTelePres.setValue(pre.getTel_res() + " - " + prestador.getTel_oficina());
   }
 }
 public void setValuesLeitor(Leitor leitor) {
   leitor.setBi(tb_bi.getText());
   leitor.setEmail(tb_email.getText());
   leitor.setNome(tb_nome.getText());
   leitor.setNuit(Integer.valueOf(tb_nuit.getText()));
   leitor.setTelefone(Integer.valueOf(tb_telefone.getText()));
   leitor.setBairro(tb_bairro.getText());
 }
 public boolean camposLLenos() {
   if (txtDL01F0005.getText().compareTo("") == 0
       || txtRTF0005.getText().compareTo("") == 0
       || txtKYF0005.getText().compareTo("") == 0
       || txtSYF0005.getText().compareTo("") == 0) {
     return false;
   } else return true;
 }
 public void setValues(Operador operador) {
   operador.setBi(tb_bi.getText());
   operador.setEmail(tb_email.getText());
   operador.setNome(tb_nome.getText());
   operador.setNuit(Integer.valueOf(tb_nuit.getText()));
   operador.setTelefone(Integer.valueOf(tb_telefone.getText()));
   operador.setUsername(tb_username.getText());
   operador.setPassword(tb_password.getText());
 }
 public void clearValuesLeitor() {
   tb_bairro.setText(null);
   tb_telefone.setText(null);
   tb_bi.setText(null);
   tb_email.setRawValue(null);
   ;
   tb_nome.setText(null);
   tb_nuit.setText(null);
 }
Example #29
0
  /** Set the components for edit mode. <br> */
  private void doEdit() {

    rolShortdescription.setReadonly(false);
    rolLongdescription.setReadonly(false);

    btnCtrl.setBtnStatus_Edit();

    // remember the old vars
    doStoreInitValues();
  }
 protected void limpiarCampos() {
   txtCodigo.setValue("");
   txtNombre.setValue("");
   buscadorCiudad.settearCampo(null);
   buscadorCategoria.settearCampo(null);
   buscadorEstado.settearCampo(null);
   buscadorVendedor.settearCampo(null);
   buscadorZona.settearCampo(null);
   clave = null;
 }