Exemplo n.º 1
0
  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());
    }
  }
Exemplo n.º 2
0
 @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);
   }
 }
  @SuppressWarnings("unchecked")
  @Override
  public void doAfterCompose(Component comp) throws Exception {
    super.doAfterCompose(comp);
    webEmployee = (WebEmployee) ZkUtils.getSessionAttribute("webEmployee");
    Map<String, String> map = new HashMap<String, String>();
    map = ZkUtils.getExecutionArgs();
    String dbId = map.get("dbId");
    currentPage = map.get("currentPage");
    aDbId = dbId;
    codeDb =
        ((ErmCodeDbService) SpringUtil.getBean("ermCodeDbService"))
            .findcodeDbByDbId(dbId, webEmployee);
    if (dbId != null) {
      dbIdTxt.setValue(codeDb.getDbId());
      dbNameTxt.setValue(codeDb.getName());
      resourcesIdTxt.setValue(codeDb.getResourcesId());
      // solr查詢語句
      String solrQuery = "";
      solrQuery += "type_id:DB";
      // resourceId
      if (codeDb.getResourcesId() != null && !codeDb.getResourcesId().trim().equals("")) {
        solrQuery += " resources_id:" + codeDb.getResourcesId();
      }
      List<ErmResourcesMainfileV> resMainDbwsList =
          ((ResourcesMainDbwsSolrSearch) SpringUtil.getBean("resourcesMainDbwsSolrSearch"))
              .resourcesMainSearch(solrQuery);
      if (resMainDbwsList.size() > 0) {
        resourcesNameTxt.setValue(resMainDbwsList.get(0).getTitle());
      }
      orderNoIbx.setValue(codeDb.getOrderNo());
      urlTxt.setValue(codeDb.getUrl());
      if (codeDb.getEzproxy() != null) {
        if (codeDb.getEzproxy().equals("Y")) {
          ezproxyRdo.setSelectedIndex(0);
        } else {
          ezproxyRdo.setSelectedIndex(1);
        }
      }
      ((ErmResourcesSuunitIdService) SpringUtil.getBean("ermResourcesSuunitIdService"))
          .findBySuunitResId(dbId);
    }

    if (dbIdTxt.getValue() == null || dbIdTxt.getValue().equals("")) {
      addSuunitBtn.setDisabled(true);
      delSuunitBtn.setDisabled(true);
    }
    flushList();
    // List<ErmResourcesSuunit> sunitList=new
    // ArrayList<ErmResourcesSuunit>();
    // sunitList=((ErmResourcesSuunitIdService) SpringUtil
    // .getBean("ermResourcesSuunitIdService")).findBySuunitResId(dbId);
    // if (sunitList.size() > 0) {
    // ListModelList<ErmResourcesSuunit> listModel = new
    // ListModelList<ErmResourcesSuunit>(sunitList);
    // listModel.setMultiple(true);
    // resMainSuunitLix.setModel(listModel);
    // }

  }
Exemplo n.º 4
0
 private void doCheckRights() {
   UserWorkspace workspace = getUserWorkspace();
   //        String role = getUserWorkspace().getUserSession().getEmployeeRole();
   //        if (((getUserWorkspace().getUserSession().getOrganizationid() == 1176)
   //                || (getUserWorkspace().getUserSession().getOrganizationid() == 1413))
   //                &&
   // ((getUserWorkspace().getUserSession().getJobPositionCode().equals("Assistant Manager"))
   //                ||
   // (getUserWorkspace().getUserSession().getJobPositionCode().equals("Analyst"))
   //                || (getUserWorkspace().getUserSession().getJobPositionCode().equals("POH
   // Assistant Manager")))) {
   if (getUserWorkspace().getUserSession().getEmployeeRole().contains(1532)) {
     label_prioritas.setVisible(true);
     radiogroup_Prioritas.setVisible(true);
     label_dampak.setVisible(true);
     radiogroup_Dampak.setVisible(true);
     label_pelaksana.setVisible(true);
     listbox_NamaPelaksana.setVisible(true);
     label_target.setVisible(true);
     intbox_target.setVisible(true);
     label_hari.setVisible(true);
   } else {
     label_prioritas.setVisible(false);
     radiogroup_Prioritas.setVisible(false);
     label_dampak.setVisible(false);
     radiogroup_Dampak.setVisible(false);
     label_pelaksana.setVisible(false);
     listbox_NamaPelaksana.setVisible(false);
     label_target.setVisible(false);
     intbox_target.setVisible(false);
     label_hari.setVisible(false);
   }
 }
  @Listen("onClick=#saveBtn")
  public void addCodeDb() {
    try {
      Map<String, String> map = new HashMap<String, String>();
      map = ZkUtils.getExecutionArgs();
      ErmCodeDb ermCodeDb = new ErmCodeDb();
      List<ErmCodeDb> codeDbList =
          ((ErmCodeDbService) SpringUtil.getBean("ermCodeDbService")).findAllCodeDb(webEmployee);
      String tempId = "OB";
      Long number = (long) codeDbList.size();
      number = number + 1;
      String dbId = tempId + RandomIDGenerator.fmtLong(number, 9);
      ermCodeDb.setDbId(dbId);
      aDbId = dbId;
      dbIdTxt.setValue(dbId);
      if (dbNameTxt.getValue() != null && !"".equals(dbNameTxt.getValue())) {
        ermCodeDb.setName(dbNameTxt.getValue());
      } else {
        ZkUtils.showExclamation(
            Labels.getLabel("webErwSource.nameZhTw") + " " + Labels.getLabel("cannottNull"),
            Labels.getLabel("warn"));
        dbNameTxt.focus();
        return;
      }
      if (resourcesIdTxt.getValue() != null) {
        ermCodeDb.setResourcesId(resourcesIdTxt.getValue());
      }
      ermCodeDb.setHistory("N");
      if (ezproxyRdo.getSelectedItem().getValue() != null) {
        ermCodeDb.setEzproxy(ezproxyRdo.getSelectedItem().getValue().toString());
      }
      if (urlTxt.getValue() != null && !"".equals(urlTxt.getValue())) {
        ermCodeDb.setUrl(urlTxt.getValue());
      }
      if (orderNoIbx.getValue() != null) {
        ermCodeDb.setOrderNo(orderNoIbx.getValue());
      }
      ermCodeDb.setIsDataEffid(1);
      ermCodeDb.setWebEmployee(webEmployee);
      ermCodeDb.setCreateDate(new Date());
      ((ErmCodeDbService) SpringUtil.getBean("ermCodeDbService")).saveCodeDb(ermCodeDb);

      ((WebSysLogService) SpringUtil.getBean("webSysLogService"))
          .insertLog(
              ZkUtils.getRemoteAddr(),
              ermCodeDb.getWebEmployee().getEmployeesn(),
              "codeDb_" + ermCodeDb.getDbId());
      ZkUtils.showInformation(Labels.getLabel("saveOK"), Labels.getLabel("info"));
      dbIdTxt.setValue(ermCodeDb.getDbId());
      addSuunitBtn.setDisabled(false);
      delSuunitBtn.setDisabled(false);
      String url = "ermCodeDb/ermCodeDb.zul";
      ZkUtils.refurbishMethod(url);

    } catch (WrongValueException e) {
      log.error("新增資料庫異常" + e);
    }
  }
Exemplo n.º 6
0
  private void doWriteComponentsToBean(TPermohonan tPermohonan, Mttr mttr) {

    //        tPermohonan.setT_idoss_permohonan_id(textbox_TIdossPermohonanId.getValue());
    tPermohonan.setNama_pemohon(textbox_NamaPemohon.getValue());
    tPermohonan.setBagian_pemohon(textbox_BagianPemohon.getValue());
    Timestamp ts = new Timestamp(java.util.Calendar.getInstance().getTimeInMillis());
    tPermohonan.setTgl_permohonan(ts);
    tPermohonan.setNik_pemohon(textbox_NikPemohon.getValue());
    tPermohonan.setNama_manager(textbox_NamaManager.getValue());
    tPermohonan.setNik_manager(textbox_NikManager.getValue());
    tPermohonan.setNama_gm(textbox_NamaGm.getValue());
    tPermohonan.setNik_gm(textbox_NikGm.getValue());
    tPermohonan.setDetail_permohonan(textbox_DetailPermohonan.getValue());
    if (getUploadMedia() != null) {
      tPermohonan.setUploadStream(getUploadMedia().getStreamData());
    }
    tPermohonan.setTarget_mulai_digunakan(ts);
    String lain = textbox_Lainlain.getValue();
    tPermohonan.setLain_lain_desc(lain);
    //        radio_lainlain.setValue(lain);
    Radio type = radiogroupType_permohonan.getSelectedItem();
    tPermohonan.setType_permohonan(type.getValue());
    tPermohonan.setLain_lain_desc(textbox_Lainlain.getValue());
    tPermohonan.setUpdated_divisi(ts);
    tPermohonan.setUpdated_gm(ts);
    tPermohonan.setUpdated_manager(ts);
    tPermohonan.setUpdated_pemohon(ts);
    Radio dampak = radiogroup_Dampak.getSelectedItem();
    tPermohonan.setDampak(dampak.getValue());
    Radio prioritas = radiogroup_Prioritas.getSelectedItem();
    tPermohonan.setUrgensi(prioritas.getValue());
    tPermohonan.setCreated_user(getUserWorkspace().getUserSession().getUserName());
    tPermohonan.setUpdated_user(getUserWorkspace().getUserSession().getUserName());
    if (intbox_target.getValue() != null) {
      int target = intbox_target.getValue();
      long too = setTarget(target);
      Timestamp tanggalnya = new Timestamp(too);
      mttr.setTarget(too);
      mttr.setTarget2(Integer.toString(target));
    }
  }
Exemplo n.º 7
0
  /*public int getAssociationMode()
  {
  return Integer.valueOf(((Radiogroup) getFellow("rgMode")).getSelectedItem().getValue().toString());  // TODO überprüfen, ob .toString() funktionert
  }*/
  public void update(Object o) {
    if (o != null) logger.debug("Update Association-Editor: " + o.getClass().getCanonicalName());

    if (o != null && o instanceof CodeSystemEntityVersionAssociation) {
      CodeSystemEntityVersionAssociation cseva = (CodeSystemEntityVersionAssociation) o;
      cseva.getCodeSystemEntityVersionByCodeSystemEntityVersionId1().setCodeSystemEntity(null);
      cseva.getCodeSystemEntityVersionByCodeSystemEntityVersionId2().setCodeSystemEntity(null);

      Radiogroup rg = (Radiogroup) getFellow("rgAssociationKind");
      if (rg.getSelectedIndex() == 0)
        cseva.setAssociationKind(Definitions.ASSOCIATION_KIND.ONTOLOGY.getCode());
      else if (rg.getSelectedIndex() == 1)
        cseva.setAssociationKind(Definitions.ASSOCIATION_KIND.TAXONOMY.getCode());
      else if (rg.getSelectedIndex() == 2)
        cseva.setAssociationKind(Definitions.ASSOCIATION_KIND.CROSS_MAPPING.getCode());
      else if (rg.getSelectedIndex() == 3)
        cseva.setAssociationKind(Definitions.ASSOCIATION_KIND.LINK.getCode());

      GenericListRowType row = createRow(cseva);
      genericList.addEntry(row, 0);
    }
  }
Exemplo n.º 8
0
  @Listen("onClick = button#chartSave")
  public void chartSaveClick(MouseEvent event) {
    if (logger.isDebugEnabled()) logger.debug(" chartSave button event = " + event);
    try {
      boolean useHomeChoice = Boolean.valueOf((String) useHomeGroup.getSelectedItem().getValue());
      if (useHomeChoice) {
        Util.getConfig(null).setProperty(Constants.DNS_USE_CHOICE, Constants.DNS_USE_HOME);
      } else {
        Util.getConfig(null).setProperty(Constants.DNS_USE_CHOICE, Constants.DNS_USE_BOAT);
      }

      saveLayers(useHomeChoice);
    } catch (Exception e) {
      logger.error(e.getMessage(), e);
    }
  }
  @Command
  public void limpiar(Event evt) {
    cuentaCheques.clearErrorMessage();
    nombreCliente.clearErrorMessage();
    codigoBicEnvio.clearErrorMessage();
    codigoBicRecepcion.clearErrorMessage();
    cdContratoSicoco.clearErrorMessage();
    errorIva.clearErrorMessage();
    moneda.clearErrorMessage();

    cdContratoSicoco.setValue(null);
    cdContrato.setValue(null);
    cuentaCheques.setValue(null);
    moneda.setValue(null);
    monedaCbx.setValue(null);
    codigoBicRecepcion.setValue(null);
    codigoBicEnvio.setValue(null);
    nombreCliente.setValue(null);
    clienteAAA.setChecked(false);
    mensualidad.setChecked(false);
    anualidad.setChecked(false);
    cuentaActiva.setChecked(true);
    iva.setSelectedItem(null);

    filtroClienteAAA = "";
    filtroCodigoBicEnvio = "";
    filtroCodigoBicRecepcion = "";
    filtroContrato = "";
    filtroCuentaCheques = "";
    filtroIvaCbx = "";
    filtroMonedaCbx = "";
    filtroNombreCliente = "";

    cuentaCheques.setReadonly(false);
    fechaBaja.setVisible(false);
    fechaBajaLbl.setVisible(false);
    generaSicocoBtn.setVisible(false);
  }
  // Metodo para guardar la informacion //
  public void guardarDatos() throws Exception {
    try {
      FormularioUtil.setUpperCase(groupboxEditar);
      if (validarForm()) {
        // Cargamos los componentes //
        Anexo3_entidad anexo3_entidad = new Anexo3_entidad();
        anexo3_entidad.setCodigo_empresa(empresa.getCodigo_empresa());
        anexo3_entidad.setCodigo_sucursal(sucursal.getCodigo_sucursal());
        anexo3_entidad.setNumero_solicitud(tbxNumero_solicitud.getValue());
        anexo3_entidad.setFecha(new Timestamp(dtbxFecha.getValue().getTime()));

        anexo3_entidad.setCodigo(tbxCodigo.getValue());

        anexo3_entidad.setCodigo_paciente(tbxCodigo_paciente_a3.getValue());
        anexo3_entidad.setCobertura(rdbCobertura.getSelectedItem().getValue().toString());
        anexo3_entidad.setOrigen_general(rdbOrigen_general.getSelectedItem().getValue().toString());
        anexo3_entidad.setOrigen_profesional(
            rdbOrigen_profesional.getSelectedItem().getValue().toString());
        anexo3_entidad.setOrigen_trabajo(rdbOrigen_trabajo.getSelectedItem().getValue().toString());
        anexo3_entidad.setOrigen_transito(
            rdbOrigen_transito.getSelectedItem().getValue().toString());
        anexo3_entidad.setOrigen_evento(rdbOrigen_evento.getSelectedItem().getValue().toString());
        anexo3_entidad.setTipo_servicio(rdbTipo_servicio.getSelectedItem().getValue().toString());
        anexo3_entidad.setPrioridad(rdbPrioridad.getSelectedItem().getValue().toString());
        anexo3_entidad.setUbicacion(rdbUbicacion.getSelectedItem().getValue().toString());
        anexo3_entidad.setServicio(tbxServicio.getValue());
        anexo3_entidad.setCama(tbxCama.getValue());
        anexo3_entidad.setGuia_atencion(tbxGuia_atencion.getValue());
        anexo3_entidad.setJustificacion(tbxJustificacion.getValue());
        anexo3_entidad.setCie_p(tbxCie_p.getValue());
        anexo3_entidad.setCie_1(tbxCie_1.getValue());
        anexo3_entidad.setCie_2(tbxCie_2.getValue());
        anexo3_entidad.setCargo_reporta(tbxCargo_reporta.getValue());
        anexo3_entidad.setTel_reporta(tbxTel_reporta.getValue());
        anexo3_entidad.setCreacion_date(new Timestamp(new GregorianCalendar().getTimeInMillis()));
        anexo3_entidad.setUltimo_update(new Timestamp(new GregorianCalendar().getTimeInMillis()));
        anexo3_entidad.setDelete_date(null);
        anexo3_entidad.setCreacion_user(usuarios.getCodigo().toString());
        anexo3_entidad.setUltimo_user(usuarios.getCodigo().toString());
        // anexo3_entidad.setDelete_user(tbxDelete_user.getValue());
        anexo3_entidad.setAutorizado(tbxAutorizado.getValue());
        anexo3_entidad.setCodigo_ips(tbxCodigo_ips.getValue());
        anexo3_entidad.setCons_ips(tbxCons_ips.getValue());
        anexo3_entidad.setLeido(tbxLeido.getValue());
        anexo3_entidad.setLeido_rechazado(tbxLeido_rechazado.getValue());
        anexo3_entidad.setNro_historia(tbxNro_historia.getValue());
        anexo3_entidad.setNeed_autorizacion(tbxNeed_autorizacion.getValue());
        anexo3_entidad.setCodigo_receta(tbxCodigo_receta.getValue());

        anexo3_entidad.setNombre_reporta(tbxNombre_reporta.getValue());
        anexo3_entidad.setNro_identificacion_reporta(tbxNro_identificacion_reporta.getValue());
        anexo3_entidad.setNro_ingreso(admision_seleccionada.getNro_ingreso());
        anexo3_entidad.setDireccion_reporta(tbxDirPres.getValue());

        // anexo3_entidad.setCel_reporta(tbxCel_reporta.getValue());
        // anexo3_entidad.setEntidad(tbxEntidad.getValue());
        // anexo3_entidad.setTipo_anexo(tbxTipo_anexo.getValue());
        // anexo3_entidad.setEstado(tbxEstado.getValue());

        Map<String, Object> mapa_datos = new HashMap<String, Object>();
        mapa_datos.put("accion", tbxAccion.getValue());
        mapa_datos.put("anexo3_entidad", anexo3_entidad);
        mapa_datos.put("orden_procedimientos", orden_servicioAction.obtenerDatos());

        anexo3_entidadService.guardarDatos(mapa_datos);

        tbxCodigo.setValue(anexo3_entidad.getCodigo());
        tbxAccion.setValue("modificar");

        MensajesUtil.mensajeInformacion(
            "Informacion ..", "Los datos se guardaron satisfactoriamente");
      }

    } catch (Exception e) {
      MensajesUtil.mensajeError(e, "", this);
    }
  }
Exemplo n.º 11
0
  @Listen("onClick=#editBtn")
  public void editCodeDb() {
    try {
      List<ErmCodeDb> codeDbList =
          ((ErmCodeDbService) SpringUtil.getBean("ermCodeDbService")).findAllCodeDb(webEmployee);
      String tempId = "OB";
      Long number = (long) codeDbList.size();
      number = number + 1;
      String dbId = tempId + RandomIDGenerator.fmtLong(number, 9);
      if (!aDbId.equals("") && aDbId != null) {
        codeDb.setDbId(aDbId);
      } else {
        codeDb.setDbId(dbId);
      }
      aDbId = dbId;
      dbIdTxt.setValue(dbId);
      if (dbNameTxt.getValue() != null && !"".equals(dbNameTxt.getValue())) {
        codeDb.setName(dbNameTxt.getValue());
      } else {
        ZkUtils.showExclamation(
            Labels.getLabel("webErwSource.nameZhTw") + " " + Labels.getLabel("cannottNull"),
            Labels.getLabel("warn"));
        dbNameTxt.focus();
        return;
      }
      if (resourcesIdTxt.getValue() != null) {
        codeDb.setResourcesId(resourcesIdTxt.getValue());
      }
      codeDb.setHistory("N");
      if (ezproxyRdo.getSelectedItem().getValue() != null) {
        codeDb.setEzproxy(ezproxyRdo.getSelectedItem().getValue().toString());
      }
      if (urlTxt.getValue() != null && !"".equals(urlTxt.getValue())) {
        codeDb.setUrl(urlTxt.getValue());
      }
      if (orderNoIbx.getValue() != null) {
        codeDb.setOrderNo(orderNoIbx.getValue());
      }
      codeDb.setIsDataEffid(1);
      codeDb.setLatelyChangedDate(new Date());
      codeDb.setLatelyChangedUser(webEmployee.getEmployeesn());
      ((ErmCodeDbService) SpringUtil.getBean("ermCodeDbService")).saveCodeDb(codeDb);
      ((WebSysLogService) SpringUtil.getBean("webSysLogService"))
          .editLog(
              ZkUtils.getRemoteAddr(),
              codeDb.getWebEmployee().getEmployeesn(),
              "codeDb_" + codeDb.getDbId());

      ZkUtils.showInformation(Labels.getLabel("saveOK"), Labels.getLabel("info"));
      Listbox resCodeDbLix =
          (Listbox) editErmResDataBaseWin.getParent().getFellowIfAny("resCodeDbLix");
      Textbox name = (Textbox) editErmResDataBaseWin.getParent().getFellowIfAny("nameTxt");
      Textbox dbIdParent = (Textbox) editErmResDataBaseWin.getParent().getFellowIfAny("dbIdTxt");
      List<ErmCodeDb> codeDbList1 =
          ((ErmCodeDbService) SpringUtil.getBean("ermCodeDbService"))
              .findPublisherList("", "", name.getValue(), dbIdParent.getValue(), webEmployee);
      ListModelList<ErmCodeDb> model = new ListModelList<ErmCodeDb>(codeDbList1);
      model.setMultiple(true);
      resCodeDbLix.setModel(model);
      resCodeDbLix.setActivePage(Integer.valueOf(currentPage));
      dbIdTxt.setValue(codeDb.getDbId());
      addSuunitBtn.setDisabled(false);
      delSuunitBtn.setDisabled(false);
      /*
       * String url = "ermCodeDb/ermCodeDb.zul";
       * ZkUtils.refurbishMethod(url);
       */

    } catch (WrongValueException e) {
      log.error("新增資料庫異常" + e);
    }
  }
  @Listen("onClick = #btnrttok")
  public void btnrtok_Clicked(Event event) {

    Radiogroup tt1 = (Radiogroup) find(this.getPage(), "#tstatusthai1").get(0);
    String ty1 = "";
    if (tt1.getSelectedIndex() == 0) {
      ty1 = "นาย";
    } else if (tt1.getSelectedIndex() == 1) {
      ty1 = "นางสาว";
    } else if (tt1.getSelectedIndex() == 2) {
      ty1 = "นาง";
    }

    Radiogroup ttt1 = (Radiogroup) find(this.getPage(), "#tsex1").get(0);
    String tyy1 = "";
    if (ttt1.getSelectedIndex() == 0) {
      tyy1 = "ผู้ชาย";
    } else if (ttt1.getSelectedIndex() == 1) {
      tyy1 = "ผู้หญิง";
    }

    Radiogroup tttt1 = (Radiogroup) find(this.getPage(), "#country1").get(0);
    String tyyy1 = "";
    if (tttt1.getSelectedIndex() == 0) {
      tyyy1 = "ไทย";
    } else if (tttt1.getSelectedIndex() == 1) {
      tyyy1 = "บรูไน";
    } else if (tttt1.getSelectedIndex() == 2) {
      tyyy1 = "กัมพูชา";
    } else if (tttt1.getSelectedIndex() == 3) {
      tyyy1 = "อินโดนีเซีย";
    } else if (tttt1.getSelectedIndex() == 4) {
      tyyy1 = "ลาว";
    } else if (tttt1.getSelectedIndex() == 5) {
      tyyy1 = "มาเลเซีย";
    } else if (tttt1.getSelectedIndex() == 6) {
      tyyy1 = "พม่า";
    } else if (tttt1.getSelectedIndex() == 7) {
      tyyy1 = "ฟิลิปปินส์";
    } else if (tttt1.getSelectedIndex() == 8) {
      tyyy1 = "สิงคโปร์";
    } else if (tttt1.getSelectedIndex() == 9) {
      tyyy1 = "เวียดนาม";
    }

    Radiogroup ttttt1 = (Radiogroup) find(this.getPage(), "#currency1").get(0);
    String tyyyy1 = "";
    if (ttttt1.getSelectedIndex() == 0) {
      tyyyy1 = "บาท";
    } else if (ttttt1.getSelectedIndex() == 1) {
      tyyyy1 = "ดอลล่าร์บรูไน";
    } else if (ttttt1.getSelectedIndex() == 2) {
      tyyyy1 = "เรียล";
    } else if (ttttt1.getSelectedIndex() == 3) {
      tyyyy1 = "รูเปียห์";
    } else if (ttttt1.getSelectedIndex() == 4) {
      tyyyy1 = "กีบ";
    } else if (ttttt1.getSelectedIndex() == 5) {
      tyyyy1 = "ริงกิต";
    } else if (ttttt1.getSelectedIndex() == 6) {
      tyyyy1 = "จ๊าด";
    } else if (ttttt1.getSelectedIndex() == 7) {
      tyyyy1 = "เปโซ";
    } else if (ttttt1.getSelectedIndex() == 8) {
      tyyyy1 = "ดอลล่าร์สิงค์โปร์";
    } else if (ttttt1.getSelectedIndex() == 9) {
      tyyyy1 = "ด่ง";
    }

    Radiogroup tttttt1 = (Radiogroup) find(this.getPage(), "#tax1").get(0);
    String tyyyyy1 = "";
    if (tttttt1.getSelectedIndex() == 0) {
      tyyyyy1 = "6.6";
    } else if (tttttt1.getSelectedIndex() == 1) {
      tyyyyy1 = "3.6";
    } else if (tttttt1.getSelectedIndex() == 2) {
      tyyyyy1 = "9.7";
    } else if (tttttt1.getSelectedIndex() == 3) {
      tyyyyy1 = "4.7";
    } else if (tttttt1.getSelectedIndex() == 4) {
      tyyyyy1 = "8.5";
    } else if (tttttt1.getSelectedIndex() == 5) {
      tyyyyy1 = "5.0";
    } else if (tttttt1.getSelectedIndex() == 6) {
      tyyyyy1 = "3.9";
    } else if (tttttt1.getSelectedIndex() == 7) {
      tyyyyy1 = "3.6";
    } else if (tttttt1.getSelectedIndex() == 8) {
      tyyyyy1 = "0.2";
    } else if (tttttt1.getSelectedIndex() == 9) {
      tyyyyy1 = "8.0";
    }

    Customerthai ht = new Customerthai();

    ht.setTstatusthai1("" + ty1);

    ht.setTthai1(tthai1.getValue());
    ht.setTsurenamethai1(tsurenamethai1.getValue());

    ht.setTsex1("" + tyy1);

    ht.setDd1(Integer.parseInt(dd1.getValue()));
    ht.setMm1(Integer.parseInt(mm1.getValue()));

    ht.setYy1(Integer.parseInt(yy1.getValue()));
    ht.setTage1(Integer.parseInt(tage1.getValue()));

    ht.setTiduser1(tiduser1.getValue());

    ht.setTtell1(Integer.parseInt(ttell1.getValue()));

    ht.setTpass1(tpass1.getValue());
    ht.setTrepass1(trepass1.getValue());
    ht.setTemail1(temail1.getValue());
    ht.setTreemail1(treemail1.getValue());

    ht.setCountry1("" + tyyy1);

    ht.setTaddress1(taddress1.getValue());

    ht.setCurrency1("" + tyyyy1);
    ht.setTax1("" + tyyyyy1);

    ht.persist();
    alert("การลงทะเบียนเรียบร้อย");
    Executions.sendRedirect("regthai.zul");
  }
  public Popup generarPopupResultados(
      Textbox textboxResultado, boolean readonly, Pexamenes_paraclinicos pexamenes_paraclinicos) {
    // final Image image = (Image)form.getFellow("img_"+id_alumno);
    final Textbox tbxRes = textboxResultado;
    // popup.setId("popupResultados_" + key);
    Vlayout vlayout = new Vlayout();

    if (pexamenes_paraclinicos.getNormal_anormal().equals("S")) {
      String valor_na = (String) tbxRes.getAttribute("VALOR_NORMAL_ANORMAL");
      String valor_descripcion_na = (String) tbxRes.getAttribute("VALOR_DESCRIPCION_NA");
      final Radiogroup radiogroup_anormal = new Radiogroup();
      Radio radio_normal = new Radio("Normal");
      radio_normal.setValue("N");
      radiogroup_anormal.appendChild(radio_normal);
      radiogroup_anormal.appendChild(new Space());
      Radio radio_anormal = new Radio("Anormal");
      radio_anormal.setValue("A");
      radiogroup_anormal.appendChild(radio_anormal);

      vlayout.appendChild(radiogroup_anormal);

      final Textbox textbox_anormal = new Textbox();
      textbox_anormal.setWidth("400px");
      textbox_anormal.setRows(4);
      textbox_anormal.setVisible(false);

      if (valor_na != null) {
        if (valor_na.equals("S")) {
          radio_normal.setChecked(true);
          radio_anormal.setChecked(false);
          textbox_anormal.setVisible(true);
        } else {
          radio_anormal.setChecked(true);
          radio_normal.setChecked(false);
          textbox_anormal.setVisible(false);
        }
      } else {
        radio_normal.setChecked(true);
        radio_anormal.setChecked(false);
        textbox_anormal.setVisible(false);
      }

      if (valor_descripcion_na != null) {
        textbox_anormal.setValue(valor_descripcion_na);
      }

      radiogroup_anormal.addEventListener(
          Events.ON_CHECK,
          new EventListener<Event>() {

            @Override
            public void onEvent(Event arg0) throws Exception {
              Radio radio_seleccionado = radiogroup_anormal.getSelectedItem();
              if (radio_seleccionado != null) {
                if (radio_seleccionado.getValue().toString().equals("A")) {
                  textbox_anormal.setVisible(true);
                } else {
                  textbox_anormal.setVisible(false);
                }
                tbxRes.setAttribute(
                    "VALOR_NORMAL_ANORMAL", radio_seleccionado.getValue().toString());
              }
            }
          });

      textbox_anormal.addEventListener(
          Events.ON_CHANGING,
          new EventListener<Event>() {

            @Override
            public void onEvent(Event arg0) throws Exception {
              InputEvent inputEvent = (InputEvent) arg0;
              tbxRes.setAttribute("VALOR_DESCRIPCION_NA", inputEvent.getValue());
            }
          });

      vlayout.appendChild(textbox_anormal);
    }

    final Textbox textbox = new Textbox();
    textbox.setWidth("400px");
    textbox.setRows(8);

    vlayout.appendChild(new Label("Resultado paraclinico"));
    vlayout.appendChild(textbox);
    textbox.setValue(tbxRes.getValue());
    textbox.addEventListener(
        "onChanging",
        new EventListener() {

          @Override
          public void onEvent(Event event) throws Exception {
            InputEvent inputevent = (InputEvent) event;
            tbxRes.setValue(inputevent.getValue());
          }
        });
    final Popup popup = new Popup();
    popup.addEventListener(
        Events.ON_OPEN,
        new EventListener<Event>() {

          @Override
          public void onEvent(Event event) throws Exception {
            textbox.setValue(tbxRes.getValue());
            textbox.setFocus(true);
          }
        });
    popup.appendChild(vlayout);
    contenedor.appendChild(popup);
    return popup;
  }
  // Metodo para guardar la informacion //
  public Ficha_epidemiologia_n22 obtenerFichaEpidemiologia() {

    Ficha_epidemiologia_n22 ficha_epidemiologia_n22 = new Ficha_epidemiologia_n22();
    ficha_epidemiologia_n22.setCodigo_empresa(empresa.getCodigo_empresa());
    ficha_epidemiologia_n22.setCodigo_sucursal(sucursal.getCodigo_sucursal());
    ficha_epidemiologia_n22.setCodigo_ficha(tbxCodigo_ficha.getValue());
    ficha_epidemiologia_n22.setCodigo_diagnostico("Z000");
    ficha_epidemiologia_n22.setFecha_inicial(new Timestamp(dtbxFecha_inicial.getValue().getTime()));
    ficha_epidemiologia_n22.setIdentificacion(
        admision != null ? admision.getNro_identificacion() : null);
    ficha_epidemiologia_n22.setHaemophilus_infliuencae_b(
        rdbHaemophilus_infliuencae_b.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setDosis(tbxDosis.getValue());
    ficha_epidemiologia_n22.setFecha_ultima_dosis(
        new Timestamp(dtbxFecha_ultima_dosis.getValue().getTime()));
    ficha_epidemiologia_n22.setPresento_carne_vacuna(
        rdbPresento_carne_vacuna.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setStreptococcus_pneumoniae(
        rdbStreptococcus_pneumoniae.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setDosis2(tbxDosis2.getValue());
    ficha_epidemiologia_n22.setFecha_ultima_dosis2(
        new Timestamp(dtbxFecha_ultima_dosis2.getValue().getTime()));
    ficha_epidemiologia_n22.setPresento_carne_vacuna2(
        rdbPresento_carne_vacuna2.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setInfluenza_estacional(
        rdbInfluenza_estacional.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setDosis3(tbxDosis3.getValue());
    ficha_epidemiologia_n22.setFecha_ultima_dosis3(
        new Timestamp(dtbxFecha_ultima_dosis3.getValue().getTime()));
    ficha_epidemiologia_n22.setPresento_carne_vacuna3(
        rdbPresento_carne_vacuna3.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setFuente_de_notificacion(
        rdbFuente_de_notificacion.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setViajo_durante_14dias(
        rdbViajo_durante_14dias.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setDpto_procedencia(
        lbxDpto_procedencia.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setMunicipio_procedencia(
        lbxMunicipio_procedencia.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setProcedencia_internacional(tbxProcedencia_internacional.getValue());
    ficha_epidemiologia_n22.setContacto_con_aves(
        rdbContacto_con_aves.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setContacto_estrecho(
        rdbContacto_estrecho.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setAsma(chbAsma.isChecked());
    ficha_epidemiologia_n22.setEpoc(chbEpoc.isChecked());
    ficha_epidemiologia_n22.setDiabetes(chbDiabetes.isChecked());
    ficha_epidemiologia_n22.setVih_otras_inmu(chbVih_otras_inmu.isChecked());
    ficha_epidemiologia_n22.setEnfermedad_cardiaca(chbEnfermedad_cardiaca.isChecked());
    ficha_epidemiologia_n22.setCancer(chbCancer.isChecked());
    ficha_epidemiologia_n22.setMalnutricion(chbMalnutricion.isChecked());
    ficha_epidemiologia_n22.setEmbarazo(chbEmbarazo.isChecked());
    ficha_epidemiologia_n22.setSemana_de_gestacion(tbxSemana_de_gestacion.getValue());
    ficha_epidemiologia_n22.setObesidad(chbObesidad.isChecked());
    ficha_epidemiologia_n22.setInsuficiencia_renal(chbInsuficiencia_renal.isChecked());
    ficha_epidemiologia_n22.setToma_medicamentos(chbToma_medicamentos.isChecked());
    ficha_epidemiologia_n22.setFumador(chbFumador.isChecked());
    ficha_epidemiologia_n22.setOtros(chbOtros.isChecked());
    ficha_epidemiologia_n22.setCual(tbxCual.getValue());
    ficha_epidemiologia_n22.setTos(rdbTos.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setPostracion(rdbPostracion.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setFiebre(rdbFiebre.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setTiraje_toraxico(
        rdbTiraje_toraxico.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setDolor_garganta(
        rdbDolor_garganta.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setDolor_muscular(
        rdbDolor_muscular.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setRinorrea(rdbRinorrea.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setNo_tolera_via_oral(
        rdbNo_tolera_via_oral.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setConjuntivitis(
        rdbConjuntivitis.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setDiarrea(rdbDiarrea.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setCefalea(rdbCefalea.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setDolor_abdominal(
        rdbDolor_abdominal.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setDifucultad_respirat(
        rdbDifucultad_respirat.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setOtro(rdbOtro.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setCual_otro(tbxCual_otro.getValue());
    ficha_epidemiologia_n22.setSe_tomo_radiografia(
        rdbSe_tomo_radiografia.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setFecha_de_toma(new Timestamp(dtbxFecha_de_toma.getValue().getTime()));
    ficha_epidemiologia_n22.setHallazgo_radiografia(
        rdbHallazgo_radiografia.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setUso_antibiotico(
        rdbUso_antibiotico.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setFecha_inicio_antibioticos(
        new Timestamp(dtbxFecha_inicio_antibioticos.getValue().getTime()));
    ficha_epidemiologia_n22.setUso_antiviral(
        rdbUso_antiviral.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setFecha_inicio_antiviral(
        new Timestamp(dtbxFecha_inicio_antiviral.getValue().getTime()));
    ficha_epidemiologia_n22.setHubo_complicaciones(
        rdbHubo_complicaciones.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setCuales_complicaciones(
        rdbCuales_complicaciones.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setCuales3(tbxCuales3.getValue());
    ficha_epidemiologia_n22.setServicio_hopitalizo(
        rdbServicio_hopitalizo.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setDiganostico_inicial(
        lbxDiganostico_inicial.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setDiagnostico_al_egreso(
        lbxDiagnostico_al_egreso.getSelectedItem().getValue().toString());
    ficha_epidemiologia_n22.setFecha_de_toma1(
        new Timestamp(dtbxFecha_de_toma1.getValue().getTime()));
    ficha_epidemiologia_n22.setFecha_de_recepcion(
        new Timestamp(dtbxFecha_de_recepcion.getValue().getTime()));
    ficha_epidemiologia_n22.setMuestra(chbMuestra.isChecked());
    ficha_epidemiologia_n22.setPrueba(chbPrueba.isChecked());
    ficha_epidemiologia_n22.setAgente(tbxAgente.getValue());
    ficha_epidemiologia_n22.setResultado(tbxResultado.getValue());
    ficha_epidemiologia_n22.setFecha_de_recepcion1(
        new Timestamp(dtbxFecha_de_recepcion1.getValue().getTime()));
    ficha_epidemiologia_n22.setValor_registrado(tbxValor_registrado.getValue());
    ficha_epidemiologia_n22.setFecha_de_toma2(
        new Timestamp(dtbxFecha_de_toma2.getValue().getTime()));
    ficha_epidemiologia_n22.setFecha_de_recepcion2(
        new Timestamp(dtbxFecha_de_recepcion2.getValue().getTime()));
    ficha_epidemiologia_n22.setMuestra2(chbMuestra2.isChecked());
    ficha_epidemiologia_n22.setPrueba2(chbPrueba2.isChecked());
    ficha_epidemiologia_n22.setAgente2(tbxAgente2.getValue());
    ficha_epidemiologia_n22.setResultado2(tbxResultado2.getValue());
    ficha_epidemiologia_n22.setFecha_de_recepcion22(
        new Timestamp(dtbxFecha_de_recepcion22.getValue().getTime()));
    ficha_epidemiologia_n22.setValor_registrado2(tbxValor_registrado2.getValue());
    ficha_epidemiologia_n22.setDiligenciado_por(tbxDiligenciado_por.getValue());
    ficha_epidemiologia_n22.setTelefono_de_contacto(tbxTelefono_de_contacto.getValue());
    ficha_epidemiologia_n22.setCreacion_date(
        new Timestamp(new GregorianCalendar().getTimeInMillis()));
    ficha_epidemiologia_n22.setUltimo_update(
        new Timestamp(new GregorianCalendar().getTimeInMillis()));
    ficha_epidemiologia_n22.setCreacion_user(usuarios.getCodigo().toString());
    ficha_epidemiologia_n22.setDelete_date(null);
    ficha_epidemiologia_n22.setUltimo_user(usuarios.getCodigo().toString());
    ficha_epidemiologia_n22.setDelete_user(null);

    return ficha_epidemiologia_n22;
  }
Exemplo n.º 15
0
 @Command
 @NotifyChange({
   "strCuentaCheques",
   "ctaCheqReadOnly",
   "strNombreCliente",
   "strCodigoBicRecepcion",
   "strCodigoBicEnvio",
   "strCdContratoSicoco",
   "boolOnce",
   "boolDieciseis",
   "strMonedaCbxId",
   "strMonedaCbxValue",
   "boolClienteAAA",
   "boolCuentaActiva",
   "boolMensualidad",
   "boolAnualidad",
   "dateFechaAlta",
   "dateFechaBaja",
   "lblFechaBaja",
   "dateBoxFecha",
   "boolGeneraReporteServicoBtn",
   "clientes",
   "strCdContrato"
 })
 public void showModal(Event evt) {
   Map<String, Object> mapDatos;
   mapDatos = new HashMap<String, Object>();
   logger.debug("this.strCuentaCheques:" + this.cuentaCheques.getValue());
   if (!this.cuentaCheques.getValue().isEmpty()) {
     tgm138Mt101ctrato = new Tgm138Mt101ctrato();
     tgm138Mt101ctrato.setCdCuentaCheques(cuentaCheques.getValue().toUpperCase().trim());
     tgm138Mt101ctrato.setCdMoneda(new Integer(moneda.getValue()));
     tgm138Mt101ctrato.setNbMoneda(monedaCbx.getValue());
     tgm138Mt101ctrato.setCdCodSwRec(codigoBicRecepcion.getValue().toUpperCase().trim());
     tgm138Mt101ctrato.setCdCodSwEnv(codigoBicEnvio.getValue().toUpperCase().trim());
     tgm138Mt101ctrato.setNbEmpresa(nombreCliente.getValue().toUpperCase().trim());
     tgm138Mt101ctrato.setCdTpClienteAaa(
         ((Boolean) clienteAAA.isChecked()).toString().trim().equals("true") ? "1" : "0");
     tgm138Mt101ctrato.setCdContratoSicoco(cdContratoSicoco.getValue());
     tgm138Mt101ctrato.setCdContrato(new Long(cdContrato.getValue().toUpperCase().trim()));
     tgm138Mt101ctrato.setCdMensualidad(
         ((Boolean) mensualidad.isChecked()).toString().trim().equals("true") ? "1" : "0");
     tgm138Mt101ctrato.setCdAnualidad(
         ((Boolean) anualidad.isChecked()).toString().trim().equals("true") ? "1" : "0");
     tgm138Mt101ctrato.setCdIva(new Integer((String) iva.getSelectedItem().getValue()));
     Timestamp timestampFechaAlta = new Timestamp(fechaAlta.getValue().getTime());
     tgm138Mt101ctrato.setFhAlta(timestampFechaAlta);
     tgm138Mt101ctrato.setFhBaja(fechaBaja.getValue() != null ? fechaBaja.getValue() : null);
     mapDatos.put("numeroCuenta", this.cuentaCheques.getValue());
     mapDatos.put("tgm138Mt101ctrato", tgm138Mt101ctrato);
     Window window =
         (Window)
             Executions.createComponents(
                 "/WEB-INF/flows/reporteServicio/reporteServicio.zul", this.getSelf(), mapDatos);
     window.doModal();
   } else {
     Messagebox.show(
         "¡Primero debe de seleccionar el cliente a consultar!",
         "Error",
         Messagebox.OK,
         Messagebox.ERROR);
   }
 }
Exemplo n.º 16
0
  @Command
  @NotifyChange({"clientes"})
  public void setCliente(Event evt) {
    clientesBean = new ClientesBean();

    cuentaCheques.clearErrorMessage();
    nombreCliente.clearErrorMessage();
    codigoBicEnvio.clearErrorMessage();
    codigoBicRecepcion.clearErrorMessage();
    cdContratoSicoco.clearErrorMessage();
    errorIva.clearErrorMessage();
    moneda.clearErrorMessage();

    logger.debug("Entrando");
    logger.debug(cuentaCheques.getValue());
    logger.debug(nombreCliente.getValue());
    logger.debug(codigoBicRecepcion.getValue());
    logger.debug(codigoBicEnvio.getValue());
    logger.debug(iva.getSelectedItem() != null ? iva.getSelectedItem().getValue() : "");
    logger.debug(moneda.getValue());
    logger.debug(clienteAAA.isChecked());
    logger.debug(cuentaActiva.isChecked());
    logger.debug(mensualidad.isChecked());
    logger.debug(anualidad.isChecked());
    logger.debug(fechaAlta.getValue());
    logger.debug(cdContratoSicoco.getValue());

    boolean errorGuardar = false;
    if (cuentaCheques.getValue().isEmpty()) {
      cuentaCheques.setErrorMessage("Favor de introducir el Número de Cuenta de Cheques");
      errorGuardar = true;
    } else if (cuentaCheques.getValue().length() < 10) {
      cuentaCheques.setErrorMessage("El Número de Cuenta de Cheques dede ser de 10 digitos");
      errorGuardar = true;
    } else if (!cuentaCheques.getValue().matches(".[0-9]+")) {
      cuentaCheques.setErrorMessage("El Número de Cuenta de Cheques solo debe contener números");
      errorGuardar = true;
    }

    if (codigoBicRecepcion.getValue().isEmpty()) {
      codigoBicRecepcion.setErrorMessage("Favor de introducir el Código BIC de Recepción");
      errorGuardar = true;
    } else if (codigoBicRecepcion.getValue().length() < 11) {
      codigoBicRecepcion.setErrorMessage("El Código BIC de Recepción dede ser de 11 digitos");
      errorGuardar = true;
    } else if (!codigoBicRecepcion.getValue().matches(".[a-zA-Z0-9]+")) {
      codigoBicRecepcion.setErrorMessage(
          "El Código BIC de Recepción solo debe contener números o letras");
      errorGuardar = true;
    }

    if (!codigoBicEnvio.getValue().isEmpty()) {
      if (codigoBicEnvio.getValue().length() < 11) {
        codigoBicEnvio.setErrorMessage("El Código BIC de Envío dede ser de 11 digitos");
        errorGuardar = true;
      } else if (!codigoBicEnvio.getValue().matches(".[a-zA-Z0-9]+")) {
        codigoBicEnvio.setErrorMessage(
            "El Código BIC de Envío solo debe contener números o letras");
        errorGuardar = true;
      }
    }

    if (cdContratoSicoco.getValue().isEmpty()) {
      cdContratoSicoco.setErrorMessage("Favor de introducir el Número de Contrato");
      errorGuardar = true;
    } else if (cdContratoSicoco.getValue().length() < 12) {
      cdContratoSicoco.setErrorMessage("El Número de Contado dede ser de 12 digitos");
      errorGuardar = true;
    } else if (!cdContratoSicoco.getValue().matches(".[0-9]+")) {
      cdContratoSicoco.setErrorMessage("El Número de Contrato solo debe contener números");
      errorGuardar = true;
    }

    if (iva.getSelectedItem() == null
        || iva.getSelectedItem().getValue() == null
        || iva.getSelectedItem().getValue().toString().isEmpty()) {
      errorIva.setErrorMessage("No se ha seleccionado el valor del IVA.");
      errorGuardar = true;
    }

    if (nombreCliente.getValue().isEmpty()) {
      nombreCliente.setErrorMessage("Favor de introducir el nombre del cliente.");
      errorGuardar = true;
    }

    if (monedaCbx.getValue() != null && monedaCbx.getValue().isEmpty()) {
      monedaCbx.setErrorMessage("Favor de seleccionar la moneda");
      errorGuardar = true;
    }

    if (!cuentaActiva.isChecked()) {
      cuentaActiva.setChecked(true);
    }

    if (!errorGuardar) {
      // if(false){
      logger.info("ContratoController: - Metodo: setCliente -- **inicio**");
      tgm138Mt101ctrato = new Tgm138Mt101ctrato();
      tgm138Mt101ctrato.setCdCuentaCheques(cuentaCheques.getValue().toUpperCase().trim());
      tgm138Mt101ctrato.setCdMoneda(new Integer(moneda.getValue()));
      tgm138Mt101ctrato.setCdCodSwRec(codigoBicRecepcion.getValue().toUpperCase().trim());
      tgm138Mt101ctrato.setCdCodSwEnv(codigoBicEnvio.getValue().toUpperCase().trim());
      tgm138Mt101ctrato.setNbEmpresa(nombreCliente.getValue().toUpperCase().trim());
      tgm138Mt101ctrato.setCdTpClienteAaa(
          ((Boolean) clienteAAA.isChecked()).toString().trim().equals("true") ? "1" : "0");
      // tgm138Mt101ctrato.setCdContrato(null);
      tgm138Mt101ctrato.setCdContratoSicoco(cdContratoSicoco.getValue().toUpperCase().trim());
      tgm138Mt101ctrato.setCdMensualidad(
          ((Boolean) mensualidad.isChecked()).toString().trim().equals("true") ? "1" : "0");
      tgm138Mt101ctrato.setCdAnualidad(
          ((Boolean) anualidad.isChecked()).toString().trim().equals("true") ? "1" : "0");
      tgm138Mt101ctrato.setCdIva(new Integer((String) iva.getSelectedItem().getValue()));
      Timestamp timestampFechaAlta = new Timestamp(fechaAlta.getValue().getTime());
      tgm138Mt101ctrato.setFhAlta(timestampFechaAlta);
      // ((Boolean)this.cuentaActiva.isChecked()).toString().trim()
      if (cuentaCheques.isReadonly()) {
        if (clientesBean.existeCodigoBicRecepcion(tgm138Mt101ctrato) == null) {
          codigoBicRecepcion.setErrorMessage("No existe el código BIC de recepción capturado.");
          errorGuardar = true;
        }
        if (!tgm138Mt101ctrato.getCdCodSwEnv().isEmpty()) {
          if (clientesBean.existeCodigoBicEnvio(tgm138Mt101ctrato) == null) {
            codigoBicEnvio.setErrorMessage("No existe el código BIC de envío capturado.");
            errorGuardar = true;
          }
        }
        if (!errorGuardar) {
          logger.debug("Actualizando cliente");
          clientesBean.actualizarCliente(tgm138Mt101ctrato);
          registraEvento("editó la cuenta " + tgm138Mt101ctrato.getCdCuentaCheques());
          cdContratoSicoco.setValue(null);
          cdContrato.setValue(null);
          cuentaCheques.setValue(null);
          moneda.setValue(null);
          monedaCbx.setValue(null);
          codigoBicRecepcion.setValue(null);
          codigoBicEnvio.setValue(null);
          nombreCliente.setValue(null);
          clienteAAA.setChecked(false);
          mensualidad.setChecked(false);
          anualidad.setChecked(false);
          cuentaActiva.setChecked(false);
          iva.setSelectedItem(null);
          cuentaCheques.setReadonly(false);
          establecerFiltroClientes();

          Messagebox.show(
              "Registro actualizado con exito!!",
              "Confirmación",
              Messagebox.OK,
              Messagebox.INFORMATION);
          this.clientes = this.getAllClientes();
          this.clientesGrid.invalidate();
        }
      } else {
        if (clientesBean.obtieneCuentaCheques(tgm138Mt101ctrato) != null) {
          cuentaCheques.setErrorMessage("El número de cuenta ya tiene servicio.");
          errorGuardar = true;
        }
        if (clientesBean.existeCodigoBicRecepcion(tgm138Mt101ctrato) == null) {
          codigoBicRecepcion.setErrorMessage("No existe el código BIC de recepción capturado.");
          errorGuardar = true;
        }
        if (!tgm138Mt101ctrato.getCdCodSwEnv().isEmpty()) {
          if (clientesBean.existeCodigoBicEnvio(tgm138Mt101ctrato) == null) {
            codigoBicEnvio.setErrorMessage("No existe el código BIC de envío capturado.");
            errorGuardar = true;
          }
        }
        if (!errorGuardar) {

          logger.debug("Registrando nuevo cliente");
          clientesBean.salvarCliente(tgm138Mt101ctrato);
          registraEvento("regsitró la cuenta " + tgm138Mt101ctrato.getCdCuentaCheques());
          cdContratoSicoco.setValue(null);
          cdContrato.setValue(null);
          cuentaCheques.setValue(null);
          moneda.setValue(null);
          monedaCbx.setValue(null);
          codigoBicRecepcion.setValue(null);
          codigoBicEnvio.setValue(null);
          nombreCliente.setValue(null);
          clienteAAA.setChecked(false);
          mensualidad.setChecked(false);
          anualidad.setChecked(false);
          cuentaActiva.setChecked(false);
          iva.setSelectedItem(null);
          cuentaCheques.setReadonly(false);
          Messagebox.show(
              "Registro guardado con exito!!",
              "Confirmación",
              Messagebox.OK,
              Messagebox.INFORMATION);
          this.clientes = this.getAllClientes();
          this.clientesGrid.invalidate();
        }
      }
    }
  }