コード例 #1
0
ファイル: uRamo.cs プロジェクト: Airam1968/VS2017-SFin
    public void PegaDadosRamo(String pApelido, String pXml)
    {
        // Conexao Conn = new Conexao(pXml);

        String Qry = "EXEC crtotramo " +
                     Srelib.QStr(pApelido);


        DS = new DataSet();
        SqlCommand Command = new SqlCommand(Qry, DM.ConexaoSessao);

        Command.CommandTimeout = 99999;
        SqlDataAdapter DA = new SqlDataAdapter();

        DA.TableMappings.Add("Table", "CRTOTCED1");
        DA.SelectCommand = Command;

        DA.Fill(DS);

        DataTable DT;

        DT = DS.Tables["CRTOTCED1"];
        DataRow DR = DT.Rows[0];

        op1 = Srelib.PadData(Convert.ToString(DR["op1"]));
        op2 = Srelib.PadData(Convert.ToString(DR["op2"]));
        op3 = Convert.ToString(DR["op3"]);
        op4 = Srelib.PadDouble(Convert.ToString(DR["op4"]));

        r1 = Srelib.PadDouble(Convert.ToString(DR["r1"]));
        r2 = Srelib.PadDouble(Convert.ToString(DR["r2"]));
        r3 = Srelib.PadDouble(Convert.ToString(DR["r3"]));

        s4 = Srelib.PadDouble(Convert.ToString(DR["s4"]));



        // Conn.SqlConn.Close();

        DS.Dispose();
    }
コード例 #2
0
    public void PegaDadosDoCedente(String wcedente)
    {
        String sql = @"Select cnpj,
                              apelido, nome,
                              endereco,
                              bairro, cidade, uf, cep,
                              fone, contato, gerente, ramo, grupo,
                              isnull(l_acum,0.00) l_acum, 
                              isnull(l_acumch,0.00) l_acumch,
                              isnull(l_acumdp,0.00) l_acumdp,
                              isnull(l_sac,0.00) l_sac, 
                              isnull(l_sacch,0.00) l_sacch,
                              isnull(l_sacdp,0.00) l_sacdp,
                              dlimite,
                              isnull(l_valor,0.00) l_valor, 
                              isnull(l_titulos,0.00) l_titulos, 
                              vencimento,
                              isnull(l_nconf,0.00) l_nconf, 
                              isnull(limitech,0.00) limitech, 
                              isnull(pconfir,0.00) pconfir, 
                              isnull(cnpjmin,0.00) cnpjmin, 
                              isnull(prazomin,0) prazomin, 
                              isnull(prazomax,0) prazomax,
                              isnull(tdesc,0.00) tdesc, 
                              isnull(txserv,0.00) txserv 
                       from cedente where apelido=@cedente";

        SqlParameter[] parametros = { new SqlParameter("@cedente", wcedente) };
        DataSet        Ds         = SreDblib.GetDsCp(sql, parametros);

        // dados
        apelido       = "";
        cnpjformatado = "";
        cnpj          = "";
        raiz_cnpj     = "";
        grupo         = "";
        gerente       = "";
        ramo          = "";
        razaosocial   = "";
        endereco      = "";
        bairro        = "";
        cidade        = "";
        uf            = "";
        cep           = "";
        fones         = "";
        contatos      = "";
        l_acum        = "0.00";
        l_acumch      = "0.00";
        l_acumdp      = "0.00";
        l_sac         = "0.00";
        l_sacch       = "0.00";
        l_sacdp       = "0.00";
        fixacao       = "";
        l_valor       = "0.00";
        l_titulos     = "0";
        vencimento    = "";
        l_nconf       = "0.00";
        limitech      = "0.00";
        pconfir       = "0.00";
        cnpjmin       = "0.00";
        prazomin      = "0";
        prazomax      = "0";
        tdesc         = "0.00";
        txserv        = "0.00";

        if (Ds.Tables.Count > 0)
        {
            apelido   = Ds.Tables[0].Rows[0]["apelido"].ToString();
            cnpj      = Ds.Tables[0].Rows[0]["cnpj"].ToString();
            raiz_cnpj = cnpj;
            if (cnpj.Trim().Length == 14)
            {
                raiz_cnpj = raiz_cnpj.Substring(0, 8);
            }
            cnpjformatado = Srelib.FormataCPFCNPJ(cnpj);
            razaosocial   = Ds.Tables[0].Rows[0]["nome"].ToString();
            endereco      = Ds.Tables[0].Rows[0]["endereco"].ToString();
            bairro        = Ds.Tables[0].Rows[0]["bairro"].ToString();
            cidade        = Ds.Tables[0].Rows[0]["cidade"].ToString();
            uf            = Ds.Tables[0].Rows[0]["uf"].ToString();
            cep           = Ds.Tables[0].Rows[0]["cep"].ToString();
            fones         = Ds.Tables[0].Rows[0]["fone"].ToString();
            contatos      = Ds.Tables[0].Rows[0]["contato"].ToString();
            gerente       = Ds.Tables[0].Rows[0]["gerente"].ToString();
            ramo          = Ds.Tables[0].Rows[0]["ramo"].ToString();
            grupo         = Ds.Tables[0].Rows[0]["grupo"].ToString();

            l_titulos  = Ds.Tables[0].Rows[0]["l_titulos"].ToString();
            l_valor    = Srelib.PadDouble(Ds.Tables[0].Rows[0]["l_valor"].ToString());
            l_acum     = Srelib.PadDouble(Ds.Tables[0].Rows[0]["l_acum"].ToString());
            l_acumdp   = Srelib.PadDouble(Ds.Tables[0].Rows[0]["l_acumdp"].ToString());
            l_acumch   = Srelib.PadDouble(Ds.Tables[0].Rows[0]["l_acumch"].ToString());
            l_sac      = Srelib.PadDouble(Ds.Tables[0].Rows[0]["l_sac"].ToString());
            l_sacdp    = Srelib.PadDouble(Ds.Tables[0].Rows[0]["l_sacdp"].ToString());
            l_sacch    = Srelib.PadDouble(Ds.Tables[0].Rows[0]["l_sacch"].ToString());
            vencimento = Srelib.PadData(Ds.Tables[0].Rows[0]["vencimento"].ToString());
            l_nconf    = Srelib.PadDouble(Ds.Tables[0].Rows[0]["l_nconf"].ToString());
            limitech   = Srelib.PadDouble(Ds.Tables[0].Rows[0]["limitech"].ToString());
            pconfir    = Srelib.PadDouble(Ds.Tables[0].Rows[0]["pconfir"].ToString());
            cnpjmin    = Srelib.PadDouble(Ds.Tables[0].Rows[0]["cnpjmin"].ToString());
            prazomin   = Ds.Tables[0].Rows[0]["prazomin"].ToString();
            prazomax   = Ds.Tables[0].Rows[0]["prazomax"].ToString();
            fixacao    = Srelib.PadData(Ds.Tables[0].Rows[0]["dlimite"].ToString());
            tdesc      = Srelib.PadDouble(Ds.Tables[0].Rows[0]["tdesc"].ToString());
            txserv     = Srelib.PadDouble(Ds.Tables[0].Rows[0]["txserv"].ToString());
        }
    }