예제 #1
0
  public void montaTelaForm(AcessoTO acessoTO, AcessoFormBean formulario) throws Exception {
    if (Util.isNumeric(acessoTO.getCodigoAcesso()))
      formulario.setCodigoAcesso(Long.parseLong(acessoTO.getCodigoAcesso()));

    formulario.setCdSite(acessoTO.getCdSite());
    formulario.setCodigoTipoAcesso(acessoTO.getCodigoTipoAcessoSSA());
    formulario.setCodigoInterface(acessoTO.getCodigoInterfaceSSA());
    formulario.setCodigoCaracteristicaInterface(
        "1"); // forçar "1" para não dar erro de PARENT KEY NOT FOUND
    formulario.setCodigoFornecedor(acessoTO.getCodigoFornecedor());
    formulario.setNumeroSEV(acessoTO.getNumeroSEV());
    formulario.setDtSEV(Util.convertDateToString(acessoTO.getDataSEV(), "dd/MM/yyyy"));
    formulario.setNumeroVelocidadeAcesso(acessoTO.getNumeroVelocidadeAcesso());
    formulario.setMudancaAcesso(acessoTO.getMudancaAcesso());
    formulario.setAtivacao(
        TipoAcaoEnum.INCLUSAO.getTipo().equals(acessoTO.getTpAcao())
            || acessoTO.getTpAcao() == null);
    formulario.setTpAcao(acessoTO.getTpAcao());

    if (acessoTO.getNumeroVelocidadeServico() == null
        || "null".equals(acessoTO.getNumeroVelocidadeServico().toLowerCase()))
      formulario.setNumeroVelocidadeServico("");
    else formulario.setNumeroVelocidadeServico(acessoTO.getNumeroVelocidadeServico());

    if (acessoTO.getMudancaAcesso() != null && acessoTO.getMudancaAcesso().equals("S"))
      formulario.setMudancaAcessoBoolean(true);
    else formulario.setMudancaAcessoBoolean(false);

    formulario.setAlteracaoBanda(acessoTO.getAlteracaoBanda());

    if (acessoTO.getAlteracaoBanda() != null && acessoTO.getAlteracaoBanda().equals("S"))
      formulario.setAlteracaoBandaBoolean(true);
    else formulario.setAlteracaoBandaBoolean(false);
  }
예제 #2
0
  public void preencheTOsdeCombo(AcessoTO acessoTO, AcessoFormBean formulario)
      throws NumberFormatException, DelegateException, BusinessException {
    if (Util.isNumeric(acessoTO.getCodigoCaracteristicaInterface()))
      formulario.setCaracteristicaInterfaceTO(
          (CaracteristicaInterfaceTO)
              CaracteristicaInterfaceDelegate.getInstance()
                  .read(Long.valueOf(acessoTO.getCodigoCaracteristicaInterface())));
    else formulario.setCaracteristicaInterfaceTO(new CaracteristicaInterfaceTO());

    if (Util.isNumeric(acessoTO.getCodigoInterface()))
      formulario.setInterfaceTO(
          (InterfaceTO)
              InterfaceDelegate.getInstance().read(Long.valueOf(acessoTO.getCodigoInterface())));
    else formulario.setInterfaceTO(new InterfaceTO());

    if (Util.isNumeric(acessoTO.getCodigoInterfaceSSA()))
      formulario.setInterfaceTO(
          (InterfaceTO)
              InterfaceDelegate.getInstance().read(Long.valueOf(acessoTO.getCodigoInterfaceSSA())));
    else formulario.setInterfaceTO(new InterfaceTO());

    if (Util.isNumeric(acessoTO.getCodigoTipoAcesso()))
      formulario.setTipoAcessoTO(
          (TipoAcessoTO)
              TipoAcessoDelegate.getInstance().read(Long.valueOf(acessoTO.getCodigoTipoAcesso())));
    else formulario.setTipoAcessoTO(new TipoAcessoTO());

    if (Util.isNumeric(acessoTO.getCodigoTipoAcessoSSA()))
      formulario.setTipoAcessoTO(
          (TipoAcessoTO)
              TipoAcessoDelegate.getInstance()
                  .read(Long.valueOf(acessoTO.getCodigoTipoAcessoSSA())));
    else formulario.setTipoAcessoTO(new TipoAcessoTO());

    if (Util.isNumeric(acessoTO.getCodigoFornecedor()))
      formulario.setProvedorAcessoTO(
          (ProvedorAcessoTO)
              ProvedorAcessoDelegate.getInstance()
                  .read(Long.valueOf(acessoTO.getCodigoFornecedor())));
    else formulario.setProvedorAcessoTO(new ProvedorAcessoTO());
  }