示例#1
0
  private void montaListaCampos() {

    /** ************* UF * ************ */
    lcUF.setUsaME(false);
    lcUF.add(new GuardaCampo(txtSiglaUF, "SiglaUf", "Sigla", ListaCampos.DB_PK, true));
    lcUF.add(new GuardaCampo(txtNomeUF, "NomeUf", "Nome", ListaCampos.DB_SI, false));
    lcMunic.setDinWhereAdic("CODPAIS = #S", txtCodPais);
    lcUF.montaSql(false, "UF", "SG");
    lcUF.setQueryCommit(false);
    lcUF.setReadOnly(true);
    txtSiglaUF.setTabelaExterna(lcUF, FUF.class.getCanonicalName());

    /** ************* MUNICIPIO * ************ */
    lcMunic.setUsaME(false);
    lcMunic.add(new GuardaCampo(txtCodMunic, "CodMunic", "Cód.Muni", ListaCampos.DB_PK, true));
    lcMunic.add(new GuardaCampo(txtDescMun, "NomeMunic", "Nome Muni.", ListaCampos.DB_SI, false));
    lcMunic.setDinWhereAdic("SIGLAUF = #S", txtSiglaUF);
    lcMunic.montaSql(false, "MUNICIPIO", "SG");
    lcMunic.setQueryCommit(false);
    lcMunic.setReadOnly(true);
    txtCodMunic.setTabelaExterna(lcMunic, FMunicipio.class.getCanonicalName());

    /** ************* PAÍS * ************ */
    lcPais.setUsaME(false);
    lcPais.add(new GuardaCampo(txtCodPais, "CodPais", "Cod.país.", ListaCampos.DB_PK, false));
    lcPais.add(new GuardaCampo(txtDescPais, "NomePais", "Nome", ListaCampos.DB_SI, false));
    lcPais.montaSql(false, "PAIS", "SG");
    lcPais.setQueryCommit(false);
    lcPais.setReadOnly(true);
    txtCodPais.setTabelaExterna(lcPais, FPais.class.getCanonicalName());

    /** *********************** FORNECEDOR (CONTADOR) * *********************** */
    lcFor.add(new GuardaCampo(txtCodFor, "CodFor", "Cód.for.", ListaCampos.DB_PK, false));
    lcFor.add(
        new GuardaCampo(txtNomeFor, "NomeFor", "nome do fornecedor", ListaCampos.DB_SI, false));
    lcFor.add(
        new GuardaCampo(
            txtRazFor, "RazFor", "Razão social do fornecedor", ListaCampos.DB_SI, false));

    //	lcFor.add( new GuardaCampo( txtCNPJFor, "CnpjFor", "CNPJ", ListaCampos.DB_SI, false ) );
    //	lcFor.add( new GuardaCampo( txtEstFor, "UFFor", "UF", ListaCampos.DB_SI, false ) );
    //	lcFor.add( new GuardaCampo( txtEmailFor, "EmailFor", "Email", ListaCampos.DB_SI, false ) );

    lcFor.montaSql(false, "FORNECED", "CP");
    lcFor.setQueryCommit(false);
    lcFor.setReadOnly(true);
    txtCodFor.setTabelaExterna(lcFor, FFornecedor.class.getCanonicalName());
  }