Example #1
0
    public void AutenticaEmail(string wempresa, ref bool wckemail, ref bool wckssl, ref string wsmtpporta, ref string wlogin, ref string wsenha, ref bool wcktls)
    {
        String script = "SELECT ckemail, ckssl, smtpporta, login, senha, cktls " +
                        "FROM empresa WITH(NOLOCK) " +
                        "WHERE apelido = " + Srelib.QStr(wempresa);
        DataSet ds = SreDblib.GetDsScript(script);


        if (ds.Tables[0].Rows.Count == 0)
        {
            wckemail   = false;
            wsmtpporta = "";
            wlogin     = "";
            wsenha     = "";
            wckssl     = false;
            wcktls     = false;
        }
        else
        {
            wckemail   = Convert.ToBoolean(ds.Tables[0].Rows[0]["ckemail"].ToString());
            wckssl     = Convert.ToBoolean(ds.Tables[0].Rows[0]["ckssl"].ToString());
            wcktls     = Convert.ToBoolean(ds.Tables[0].Rows[0]["cktls"].ToString());
            wsmtpporta = ds.Tables[0].Rows[0]["smtpporta"].ToString();
            wlogin     = ds.Tables[0].Rows[0]["login"].ToString();
            wsenha     = ds.Tables[0].Rows[0]["senha"].ToString();
        }
        ds.Clear();
    }
Example #2
0
    public static DataSet PegaDadosFornecedoresID(string xID)
    {
        string script;

        if ((SreDblib.GetParametro("ORDEM FORNECEDOR") != "CODIGO") && (SreDblib.GetParametro("ORDEM FORNECEDOR") != "CÓDIGO"))
        {
            if ((xID == "0") || (xID == string.Empty))
            {
                script = "SELECT * FROM fornecedores WITH(NOLOCK) order by Apelido";
            }
            else
            {
                script = "SELECT * FROM fornecedores WITH(NOLOCK) WHERE codigo in (" + Convert.ToString(xID) + ") order by Apelido";
            }
        }
        else
        {
            if ((xID == "0") || (xID == string.Empty))
            {
                script = "SELECT * FROM fornecedores WITH(NOLOCK) order by CODIGO ";
            }
            else
            {
                script = "SELECT * FROM fornecedores WITH(NOLOCK) WHERE codigo in (" + Convert.ToString(xID) + ") order by CODIGO ";
            }
        }
        return(SreDblib.GetDsScript(script));
    }
Example #3
0
    public static ASPxListBox MontaListMultCk(ASPxListBox pListBox, string pTabela, string pCampoExibe, string pCampoValor, Boolean pExibeValor)
    {
        //Documentação - Chamada da Função
        //
        //String[] Campos = { "tipo", "descricao", "apelido" };
        //RgbDbLib.MontaComboFullCk(ListBoxModelo2, "tcobran", Campos, "tipo", true);
        //
        //Todas as Caracteristicas do Combo são montadas na Classe, a chamada passa do combo vazio.
        //1o. Campo da Lista é um CheckBox
        //Fim Documentação - Chamada da Função


        String       script = "SELECT " + pCampoExibe + "," + pCampoValor + " FROM " + pTabela + " WITH(NOLOCK)";
        DataSet      ds     = SreDblib.GetDsScript(script);
        ListEditItem le;

        foreach (DataRow dr in ds.Tables[0].Rows)
        {
            le = new ListEditItem();
            if (pExibeValor)
            {
                le.Text = dr[pCampoValor].ToString() + " - " + dr[pCampoExibe].ToString();
            }
            else
            {
                le.Text = dr[pCampoExibe].ToString();
            };

            le.Value = dr[pCampoValor].ToString();
            pListBox.Items.Add(le);
        }

        return(pListBox);
    }
Example #4
0
    public static ASPxListBox MontaListMult(ASPxListBox pCombo, string pTabela, string[] pCamposExibe, string pCampoValor, Boolean pExibeValor)
    {
        //Documentação - Chamada da Função
        //
        //String[] Campos = { "tipo", "descricao", "apelido" };
        //RgbDbLib.MontaListMult(ListBoxModelo2, "tcobran", Campos, "tipo", true);
        //
        //O Search será sempre pelo 1o. campo do Select
        //O Campo de valor Não precisa ser passado na lista de campos, porque ele vem através de pCampoValor
        //Fim Documentação - Chamada da Função

        String script = "SELECT ";

        foreach (String item in pCamposExibe)
        {
            script = script + item + ",";
        }
        script = script + pCampoValor + " FROM " + pTabela + " WITH(NOLOCK)";
        DataSet ds = SreDblib.GetDsScript(script);

        pCombo.DataSource = ds;
        pCombo.ValueField = pCampoValor;
        pCombo.DataBind();

        return(pCombo);
    }
Example #5
0
    public static String PegacepID(string xID)
    {
        string  script    = "SELECT endereco FROM Contato WITH(NOLOCK) WHERE ID = " + xID;
        string  resultado = "";
        DataSet ds;

        resultado = SreDblib.GetCampoScript(script);
        if (resultado == "R")
        {
            //Residencial
            script = "SELECT enderecores, enderecoresnumero, enderecorescomplem, bairrores, cidaderes, ufres, cepres FROM Contato WITH(NOLOCK) WHERE ID = " + xID;
            ds     = SreDblib.GetDsScript(script);

            resultado = ds.Tables[0].Rows[0]["cepres"].ToString();
        }
        else
        {
            //Comercial
            script = "SELECT enderecocom, enderecocomnumero, enderecocomcomplem, bairrocom, cidadecom, ufcom, cepcom FROM Contato WITH(NOLOCK) WHERE ID = " + xID;
            ds     = SreDblib.GetDsScript(script);

            resultado = ds.Tables[0].Rows[0]["cepcom"].ToString();
        }

        return(resultado);
    }
Example #6
0
    public static DataSet LookUpLogAcoes(string xusuario,
                                         string xData1,
                                         string xData2,
                                         string xModulo,
                                         string xAcao,
                                         string xComplementoAcao)
    {
        //
        string script;

        if (xusuario == "")
        {
            script = "SELECT * FROM log WITH(NOLOCK) WHERE (DataHora >= " + Srelib.QStr(Srelib.DataAmericanasembarra(xData1)) +
                     " and DataHora <= " + Srelib.QStr(Srelib.DataAmericanasembarra(xData2)) + ") ";
        }
        else
        {
            script = "SELECT * FROM log WITH(NOLOCK) WHERE Login = "******" and (DataHora >= " + Srelib.QStr(Srelib.DataAmericanasembarra(xData1)) +
                     " and DataHora <= " + Srelib.QStr(Srelib.DataAmericanasembarra(xData2)) + ") ";
        }

        script = script + " and ((tabela like " + Srelib.QStr("%" + xComplementoAcao.ToUpper() + "%") + ") ";

        script = script + " or (obs like " + Srelib.QStr("%" + xComplementoAcao.ToUpper() + "%") + ") ";

        script = script + " or (acao like " + Srelib.QStr("%" + xComplementoAcao.ToUpper() + "%") + ")) ";

        script = script + " order by DataHora";

        return(SreDblib.GetDsScript(script));
    }
Example #7
0
    public static String PegaMensagens(string xID,
                                       ref string msg1,
                                       ref string msg2,
                                       ref string msg3,
                                       ref string msg4,
                                       ref string msg5)
    {
        DataSet ds;

        string script = "select * from boleto_mensagens " +
                        " with(nolock) " +
                        " where codigo = " + xID;
        string retorno = "";

        ds = SreDblib.GetDsScript(script);

        try
        {
            msg1 = ds.Tables[0].Rows[0]["linha1"].ToString().Trim() + Srelib.replicate(" ", 80);
            msg2 = ds.Tables[0].Rows[0]["linha2"].ToString().Trim() + Srelib.replicate(" ", 80);
            msg3 = ds.Tables[0].Rows[0]["linha3"].ToString().Trim() + Srelib.replicate(" ", 80);
            msg4 = ds.Tables[0].Rows[0]["linha4"].ToString().Trim() + Srelib.replicate(" ", 80);
            msg5 = ds.Tables[0].Rows[0]["linha5"].ToString().Trim() + Srelib.replicate(" ", 80);
        }
        catch (Exception)
        {
            retorno = "";
        }


        return(retorno);
    }
Example #8
0
    public static ASPxComboBox MontaComboCritica(ASPxComboBox pCombo)
    {
        //Documentação - Chamada da Função
        //
        //RgbDbLib.MontaComboCritica(ASPxComboBox1);
        //
        //Fim Documentação - Chamada da Função

        string  pTabela     = "codcriti";
        string  pCampoExibe = "descricao";
        string  pCampoValor = "codigo";
        Boolean pExibeValor = true;

        String       script = "SELECT " + pCampoExibe + "," + pCampoValor + " FROM " + pTabela + " WITH(NOLOCK) ORDER BY 1";
        DataSet      ds     = SreDblib.GetDsScript(script);
        ListEditItem le;

        foreach (DataRow dr in ds.Tables[0].Rows)
        {
            le = new ListEditItem();
            if (pExibeValor)
            {
                le.Text = dr[pCampoValor].ToString() + " - " + dr[pCampoExibe].ToString();
            }
            else
            {
                le.Text = dr[pCampoExibe].ToString();
            };
            le.Value = dr[pCampoValor].ToString();
            pCombo.Items.Add(le);
        }
        return(pCombo);
    }
Example #9
0
    public static DataSet PegaDadosDespesasID(string xID)
    {
        string script;

        if ((SreDblib.GetParametro("ORDEM DESPESA") != "CODIGO") && (SreDblib.GetParametro("ORDEM DESPESA") != "CÓDIGO"))
        {
            if ((xID == "0") || (xID == string.Empty))
            {
                script = "SELECT * FROM classe_despesas WITH(NOLOCK) order by descricao";
            }
            else
            {
                script = "SELECT * FROM classe_despesas WITH(NOLOCK) WHERE id in (" + Convert.ToString(xID) + ") order by descricao";
            }
        }
        else
        {
            if ((xID == "0") || (xID == string.Empty))
            {
                script = "SELECT * FROM classe_despesas WITH(NOLOCK) order by codigo";
            }
            else
            {
                script = "SELECT * FROM classe_despesas WITH(NOLOCK) WHERE id in (" + Convert.ToString(xID) + ") order by codigo";
            }
        }
        return SreDblib.GetDsScript(script);

    }
Example #10
0
    public static DataSet PegaDadosTaxasMensaisNome(String xNome, DateTime xPrevisao1, DateTime xPrevisao2)
    {
        string script;

        if (xNome == "")
        {
            script = " SELECT * FROM taxas_mensais WITH(NOLOCK) " +
                     " WHERE (Convert(DateTime," + Srelib.QStr("01/") + "+mes+" + Srelib.QStr("/") + "+ano,103) " +
                     " between " + Srelib.QStr(Srelib.DataAmericanasembarra(Convert.ToString(xPrevisao1))) +
                     " and " + Srelib.QStr(Srelib.DataAmericanasembarra(Convert.ToString(xPrevisao2))) + ") " +
                     " order by " +
                     "REPLICATE('0', 4 - LEN(ano)) + CAST(ano AS varchar), " +
                     "REPLICATE('0', 2 - LEN(mes)) + CAST(mes AS varchar) ";
        }
        else
        {
            script = "SELECT mes, ano, " + xNome + " FROM taxas_mensais WITH(NOLOCK) " +
                     " WHERE (Convert(DateTime," + Srelib.QStr("01/") + "+mes+" + Srelib.QStr("/") + "+ano,103) " +
                     " between " + Srelib.QStr(Srelib.DataAmericanasembarra(Convert.ToString(xPrevisao1))) +
                     " and " + Srelib.QStr(Srelib.DataAmericanasembarra(Convert.ToString(xPrevisao2))) + ") " +
                     " order by " +
                     "REPLICATE('0', 4 - LEN(ano)) + CAST(ano AS varchar), " +
                     "REPLICATE('0', 2 - LEN(mes)) + CAST(mes AS varchar) ";
        }

        return(SreDblib.GetDsScript(script));
    }
Example #11
0
    public static DataSet PegaDadosReceitas(string xID)
    {
        string script;

        if ((SreDblib.GetParametro("ORDEM RECEITA") != "CODIGO") && (SreDblib.GetParametro("ORDEM RECEITA") != "CÓDIGO"))
        {
            if ((xID == "0") || (xID == string.Empty))
            {
                script = "SELECT * FROM classe_receitas WITH(NOLOCK) order by descricao";
            }
            else
            {
                script = "SELECT * FROM classe_receitas WITH(NOLOCK) WHERE codigo in (" + xID + ") order by descricao";
            }
        }
        else
        {
            if ((xID == "0") || (xID == string.Empty))
            {
                script = "SELECT * FROM classe_receitas WITH(NOLOCK) order by codigo";
            }
            else
            {
                script = "SELECT * FROM classe_receitas WITH(NOLOCK) WHERE codigo in (" + xID + ") order by codigo";
            }
        }
        return(SreDblib.GetDsScript(script));
    }
Example #12
0
    public static ASPxListBox MontaList(ASPxListBox pCombo, string pTabela, string pCampoExibe, string pCampoValor, Boolean pExibeValor)
    {
        //Documentação - Chamada da Função
        //
        //RgbDbLib.MontaList(ASPxListBox1, "tcobran", "descricao", "tipo", true);
        //
        //Fim Documentação - Chamada da Função

        String       script = "SELECT " + pCampoExibe + "," + pCampoValor + " FROM " + pTabela + " WITH(NOLOCK)";
        DataSet      ds     = SreDblib.GetDsScript(script);
        ListEditItem le;

        foreach (DataRow dr in ds.Tables[0].Rows)
        {
            le = new ListEditItem();
            if (pExibeValor)
            {
                le.Text = dr[pCampoValor].ToString() + " - " + dr[pCampoExibe].ToString();
            }
            else
            {
                le.Text = dr[pCampoExibe].ToString();
            };
            le.Value = dr[pCampoValor].ToString();
            pCombo.Items.Add(le);
        }
        return(pCombo);
    }
Example #13
0
    public static String PegaContaDescricao(string xcodigo_conta)
    {
        DataSet ds;

        string script = "select id, cod_banco,cod_agencia,cod_conta,nome_agencia from CONTAS " +
                        " with(nolock) " +
                        " where ID = " + xcodigo_conta +
                        " order by id ";
        string retorno = "";

        ds = SreDblib.GetDsScript(script);

        try
        {
            retorno = ds.Tables[0].Rows[0]["ID"].ToString().Trim() + " - " +
                      ds.Tables[0].Rows[0]["cod_banco"].ToString().Trim() + " - " +
                      ds.Tables[0].Rows[0]["cod_agencia"].ToString().Trim() + " - " +
                      ds.Tables[0].Rows[0]["cod_conta"].ToString().Trim() + " - " +
                      ds.Tables[0].Rows[0]["nome_agencia"].ToString().Trim();
        }
        catch (Exception)
        {
            retorno = "0";
        }


        return(retorno);
    }
Example #14
0
    public static DataSet PegaDadosReceitasID(Int32 xID)
    {
        string script;

        if ((SreDblib.GetParametro("ORDEM RECEITA") != "CODIGO") && (SreDblib.GetParametro("ORDEM RECEITA") != "CÓDIGO"))
        {
            if (xID == 0)
            {
                script = "SELECT * FROM classe_receitas WITH(NOLOCK) order by descricao";
            }
            else
            {
                script = "SELECT * FROM classe_receitas WITH(NOLOCK) WHERE id = " + Convert.ToString(xID) + " order by descricao";
            }
        }
        else
        {
            if (xID == 0)
            {
                script = "SELECT * FROM classe_receitas WITH(NOLOCK) order by codigo";
            }
            else
            {
                script = "SELECT * FROM classe_receitas WITH(NOLOCK) WHERE id = " + Convert.ToString(xID) + " order by codigo";
            }
        }
        return(SreDblib.GetDsScript(script));
    }
Example #15
0
    public static DataSet PegaDadosProduto(Int32 xID)
    {
        string script;

        if ((SreDblib.GetParametro("ORDEM PRODUTO") != "CODIGO") || (SreDblib.GetParametro("ORDEM PRODUTO") != "CÓDIGO"))
        {
            if (xID == 0)
            {
                script = "SELECT * FROM produto WITH(NOLOCK) order by descricao";
            }
            else
            {
                script = "SELECT * FROM produto WITH(NOLOCK) WHERE id = " + Convert.ToString(xID) + " order by descricao";
            }
        }
        else
        {
            if (xID == 0)
            {
                script = "SELECT * FROM produto WITH(NOLOCK) order by ID";
            }
            else
            {
                script = "SELECT * FROM produto WITH(NOLOCK) WHERE id = " + Convert.ToString(xID) + " order by ID";
            }
        }
        return(SreDblib.GetDsScript(script));
    }
Example #16
0
    public static DataSet LookUpTcobran(string pTipo)
    {
        //Tipo = C = cheques
        //Tipo = D = Duplicatas
        //Tipo <> C e D = Todos

        string _condicao = "";

        if (pTipo == "D")
        {
            _condicao = " CKDP = 1 ";
        }

        if (pTipo == "C")
        {
            _condicao = " CKCH = 1 ";
        }

        if ((pTipo != "C") && (pTipo != "D"))
        {
            _condicao = " CKCH = 1 and CKDP = 1 ";
        }

        return(SreDblib.GetDsScript("select tipo, descricao from tcobran where " + _condicao + "order by tipo"));
    }
Example #17
0
    public static int PegaMaiorCritica(String wempresa, String wcedente, int wtipo_op, int wbordero, String wduplicata, String wbanco, String wagencia, String wconta, String wcheque)
    {
        String sql = "SELECT top 1 codigo FROM criticas WITH(NOLOCK) " +
                     "WHERE empresa=" + Srelib.QStr(wempresa) +
                     " and cedente=" + Srelib.QStr(wcedente) +
                     " and tipo_operacao=" + Convert.ToString(wtipo_op) +
                     " and bordero=" + Convert.ToString(wbordero) +
                     " and duplicata=" + Srelib.QStr(wduplicata) +
                     " and banco=" + Srelib.QStr(wbanco) +
                     " and agencia=" + Srelib.QStr(wagencia) +
                     " and conta=" + Srelib.QStr(wconta) +
                     " and cheque=" + Srelib.QStr(wcheque);

        if ((SreDblib.GetParametro("CCC") == "SIM"))
        {
            sql = sql + " and codigo>200 and codigo<255";
        }
        else
        {
            sql = sql + " and ((codigo<=200) or (codigo>=255))";
        }
        sql = sql + " ORDER BY codigo DESC";
        DataSet ds = SreDblib.GetDsScript(sql);

        if (ds.Tables[0].Rows.Count == 0)
        {
            return(0);
        }
        else
        {
            return(Convert.ToInt16(ds.Tables[0].Rows[0]["codigo"].ToString()));
        }
    }
Example #18
0
    public static ASPxComboBox MontaComboGerenteCred(ASPxComboBox pCombo, Boolean lMaster, String ccUsuario, Boolean ativo)
    {
        String script = "SELECT apelido FROM gerente WITH(NOLOCK) WHERE 1=1 ";

        if (SreDblib.GetParametro("PESQ_GER_INATIVOS") != "SIM")
        {
            script = script + "and ativo = 1";
        }
        if (!lMaster)
        {
            script = script + "and apelido in (SELECT gerente FROM ger_usu WITH(NOLOCK) WHERE usuario=" + Srelib.QStr(ccUsuario) + ")";
        }
        script = script + "ORDER BY apelido";

        DataSet      ds = SreDblib.GetDsScript(script);
        ListEditItem le;

        foreach (DataRow dr in ds.Tables[0].Rows)
        {
            le       = new ListEditItem();
            le.Text  = dr["apelido"].ToString();
            le.Value = dr["apelido"].ToString();
            pCombo.Items.Add(le);
        }
        return(pCombo);
    }
Example #19
0
    public static DataSet PegaDadosClientesID(string xID)
    {
        string script;

        if ((SreDblib.GetParametro("ORDEM CLIENTE") != "CODIGO") && (SreDblib.GetParametro("ORDEM CLIENTE") != "CÓDIGO"))
        {
            if ((xID == "0") || (xID == string.Empty))
            {
                script = "SELECT * FROM clientes WITH(NOLOCK) order by Apelido";
            }
            else
            {
                script = "SELECT * FROM clientes WITH(NOLOCK) WHERE codigo in (" + xID + ") order by Apelido";
            }
        }
        else
        {
            if ((xID == "0") || (xID == string.Empty))
            {
                script = "SELECT * FROM clientes WITH(NOLOCK) order by CODIGO";
            }
            else
            {
                script = "SELECT * FROM clientes WITH(NOLOCK) WHERE codigo in (" + xID + ") order by CODIGO";
            }
        }
        return(SreDblib.GetDsScript(script));
    }
Example #20
0
    public static ASPxComboBox MontaComboGroup(ASPxComboBox pCombo, string pTabela, string pCampoExibe, string pCampoValor, Boolean pExibeValor)
    {
        //Documentação - Chamada da Função
        //
        //RgbDbLib.MontaComboGroup(ASPxComboBox1, "tcobran", "descricao", "tipo", true);
        //
        //Especialização para select que precise de Group by em função de grande numero de registros pelo campo pCampoValor
        //
        //Fim Documentação - Chamada da Função

        String       script = "SELECT " + pCampoExibe + "," + pCampoValor + " FROM " + pTabela + " WITH(NOLOCK) Group by " + pCampoValor + " Order by " + pCampoValor;
        DataSet      ds     = SreDblib.GetDsScript(script);
        ListEditItem le;

        foreach (DataRow dr in ds.Tables[0].Rows)
        {
            le = new ListEditItem();
            if (pExibeValor)
            {
                le.Text = dr[pCampoValor].ToString() + " - " + dr[pCampoExibe].ToString();
            }
            else
            {
                le.Text = dr[pCampoExibe].ToString();
            };
            le.Value = dr[pCampoValor].ToString();
            pCombo.Items.Add(le);
        }
        return(pCombo);
    }
Example #21
0
    public static DataSet PegaDadosClientes(Int32 xID)
    {
        string script;

        if ((SreDblib.GetParametro("ORDEM CLIENTE") != "CODIGO") && (SreDblib.GetParametro("ORDEM CLIENTE") != "CÓDIGO"))
        {
            if (xID == 0)
            {
                script = "SELECT * FROM clientes WITH(NOLOCK) order by Apelido";
            }
            else
            {
                script = "SELECT * FROM clientes WITH(NOLOCK) WHERE codigo = " + Convert.ToString(xID) + " order by Apelido";
            }
        }
        else
        {
            if (xID == 0)
            {
                script = "SELECT * FROM clientes WITH(NOLOCK) order by CODIGO";
            }
            else
            {
                script = "SELECT * FROM clientes WITH(NOLOCK) WHERE codigo = " + Convert.ToString(xID) + " order by CODIGO";
            }
        }
        return(SreDblib.GetDsScript(script));
    }
Example #22
0
    public void PegaDadosCrepar()
    {
        String  sql = @"Select isnull(grupo1,0) grupo1, 
                              isnull(grupo2,0) grupo2,
                              isnull(grupo3,0) grupo3,
                              isnull(grupo4,0) grupo4,
                              isnull(ckr6,0) ckr6,
                              isnull(refat,0) refat
                       from crepar";
        DataSet Ds  = SreDblib.GetDsScript(sql);

        // dados
        grupo1 = false;
        grupo2 = false;
        grupo3 = false;
        grupo4 = false;
        ckr6   = false;
        refat  = 0;
        if (Ds.Tables.Count > 0)
        {
            grupo1 = Convert.ToBoolean(Ds.Tables[0].Rows[0]["grupo1"].ToString());
            grupo2 = Convert.ToBoolean(Ds.Tables[0].Rows[0]["grupo2"].ToString());
            grupo3 = Convert.ToBoolean(Ds.Tables[0].Rows[0]["grupo3"].ToString());
            grupo4 = Convert.ToBoolean(Ds.Tables[0].Rows[0]["grupo4"].ToString());
            ckr6   = Convert.ToBoolean(Ds.Tables[0].Rows[0]["ckr6"].ToString());
            refat  = Convert.ToInt16(Ds.Tables[0].Rows[0]["refat"].ToString());
        }
    }
Example #23
0
    public static String PegaSaldoFinalDataAnterior(string xcodigo_conta,
                                                    DateTime xdata,
                                                    ref string xsaldo_f,
                                                    ref string xsaldo_aplicacaoD,
                                                    ref string xsaldo_aplicacaoB)
    {
        //
        DataSet ds;
        string  script = "select TOP 1 * from conta_" + Srelib.QStr0(xcodigo_conta.Trim(), 5) +
                         " with(nolock) " +
                         " Where " +
                         " data < " + Srelib.QStr(Srelib.DataAmericanasembarra(Convert.ToString(xdata).Substring(0, 10))) +
                         " order by ID DESC ";

        ds = SreDblib.GetDsScript(script);
        //
        if (ds.Tables[0].Rows.Count > 0)
        {
            //Faz caso exista lançamentos anteriores a data
            //
            xsaldo_f          = ds.Tables[0].Rows[0]["saldo_f"].ToString().Trim();
            xsaldo_aplicacaoD = ds.Tables[0].Rows[0]["saldo_aplicacaoD"].ToString().Trim();
            xsaldo_aplicacaoB = ds.Tables[0].Rows[0]["saldo_aplicacaoB"].ToString().Trim();
        }
        else
        {
            //
            xsaldo_f          = uContas.PegaSaldoInicial(xcodigo_conta);
            xsaldo_aplicacaoD = uContas.PegaSaldoInicialsaldo_aplicacaoD(xcodigo_conta);
            xsaldo_aplicacaoB = uContas.PegaSaldoInicialsaldo_aplicacaoB(xcodigo_conta);
        }
        return("");
    }
Example #24
0
    public static DataSet PegaDadosTaxasMensaisNomeColunas()
    {
        string script;

        script = "SP_Columns taxas_mensais";

        return(SreDblib.GetDsScript(script));
    }
Example #25
0
    public static DataSet LookUpFcomiss()
    {
        String script = "SELECT * FROM fcomiss WITH(NOLOCK) WHERE 1=1 ";

        script = script + "ORDER BY recno";

        return(SreDblib.GetDsScript(script));;
    }
Example #26
0
    public static DataSet PegaDadosTaxasDiariasNomeColunas()
    {
        string script;

        script = "SP_Columns TAXAS_DIARIAS";

        return(SreDblib.GetDsScript(script));
    }
Example #27
0
    public static DataSet PegaDadosContatoProduto(string xcbproduto,
                                                  string xcbprodutogrupo,
                                                  string xdtprevisao1)
    {
        string script;

        //
        if (xdtprevisao1 == "01/01/1900")
        {
            script = "SELECT * FROM Contato C WITH(NOLOCK) WHERE 1 = 1 ";
            //
            if (xcbproduto != string.Empty)
            {
                script = script + " AND exists(SELECT * FROM VENDAS V WHERE V.CLIENTE = C.ID AND V.PRODUTO = " +
                         Srelib.QStr(xcbproduto) + " ";
                //
                if (xcbprodutogrupo != string.Empty)
                {
                    script = script + " AND V.GRUPO = " +
                             Srelib.QStr(xcbprodutogrupo) + " ";
                }
                script = script + " ) ";
            }

            script = script + " ORDER BY nome ";
        }
        else
        {
            script = "SELECT * FROM Contato C WITH(NOLOCK) WHERE 1 = 1 ";
            //
            if (xcbproduto != string.Empty)
            {
                script = script + " AND exists(SELECT * FROM VENDAS V WHERE V.CLIENTE = C.ID AND V.PRODUTO = " +
                         Srelib.QStr(xcbproduto) + " ";
                //
                if (xcbprodutogrupo != string.Empty)
                {
                    script = script + " AND V.GRUPO = " +
                             Srelib.QStr(xcbprodutogrupo) + " ";
                    //
                    string nomearquivo = "parcelas_" + Srelib.QStr0(xcbproduto.Trim(), 5) + "_" + Srelib.QStr0(xcbprodutogrupo.Trim(), 5);
                    script = script + " AND exists(SELECT * FROM " + nomearquivo + " P WHERE P.PRODUTO = " +
                             Srelib.QStr(xcbproduto) +
                             " AND P.GRUPO = " + Srelib.QStr(xcbprodutogrupo);
                }


                script = script + " ) ";
            }

            script = script + " ORDER BY nome ";
        }

        return(SreDblib.GetDsScript(script));
    }
Example #28
0
 public static DataSet LookUpClientes()
 {
     if ((SreDblib.GetParametro("ORDEM CLIENTE") != "CODIGO") && (SreDblib.GetParametro("ORDEM CLIENTE") != "CÓDIGO"))
     {
         return(SreDblib.GetDsScript("select codigo, apelido from clientes WITH(NOLOCK) order BY apelido "));
     }
     else
     {
         return(SreDblib.GetDsScript("select codigo, apelido from clientes WITH(NOLOCK) order BY CODIGO "));
     }
 }
Example #29
0
 public static DataSet LookUpReceitas()
 {
     if ((SreDblib.GetParametro("ORDEM RECEITA") != "CODIGO") && (SreDblib.GetParametro("ORDEM RECEITA") != "CÓDIGO"))
     {
         return(SreDblib.GetDsScript("select codigo, descricao from classe_receitas WITH(NOLOCK) ORDER BY descricao"));
     }
     else
     {
         return(SreDblib.GetDsScript("select codigo, descricao from classe_receitas WITH(NOLOCK) ORDER BY codigo"));
     }
 }
Example #30
0
 public static DataSet LookUpDespesas()
 {
     if ((SreDblib.GetParametro("ORDEM DESPESA") != "CODIGO") && (SreDblib.GetParametro("ORDEM DESPESA") != "CÓDIGO"))
     {
         return SreDblib.GetDsScript("select codigo, descricao from classe_despesas WITH(NOLOCK) ORDER BY descricao");
     }
     else
     {
         return SreDblib.GetDsScript("select codigo, descricao from classe_despesas WITH(NOLOCK) ORDER BY codigo");
     }
 }