Example #1
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 #2
0
 protected void btdesmarcar_Click(object sender, EventArgs e)
 {
     // Habilitar
     lookupusuario.Enabled = true;
     btprocessa.Enabled    = true;
     btdesmarcar.Enabled   = true;
     btimprimir.Enabled    = false;
     dtinicio.Enabled      = true;
     dtfim.Enabled         = true;
     cktudoperiodo.Enabled = true;
     cbAcao.Enabled        = true;
     cbModulo.Enabled      = true;
     edComplemento.Enabled = true;
     cbModulo.Text         = "";
     cbAcao.Text           = "";
     edComplemento.Text    = "";
     lookupusuario.Selection.UnselectAll();
     lookuplog.Selection.UnselectAll();
     // lookuplog
     dslog = uLog.LookUpLog("", Srelib.DataAmericanasembarra(dtinicio.Text), Srelib.DataAmericanasembarra(dtfim.Text), "", "", "");
     lookuplog.DataSource   = dslog;
     lookuplog.KeyFieldName = "DataHora";
     lookuplog.DataBind();
     Label3.Text = "Log do Usuário (Todos)";
 }
Example #3
0
    public static String Grava(string xlogin,
                               string xdata,
                               string xhora,
                               string xtabela,
                               string xoperacao,
                               string xobs,
                               string xacao)
    {
        if (xlogin != String.Empty)
        {
            if (Convert.ToInt32(xhora.Substring(0, 2)) > 23)
            {
                xhora = "00:00:00";
            }

            string script = "INSERT INTO LOG VALUES ( " +
                            Srelib.QStr(xlogin) +
                            ", " + Srelib.QStr(Srelib.DataAmericanasembarra(xdata) + " " + xhora) +
                            ", newid() " +
                            ", " + Srelib.QStr(xtabela) +
                            ", " + Srelib.QStr(xoperacao) +
                            ", " + Srelib.QStr(xobs) +
                            ", " + Srelib.QStr(xacao) +
                            " ) ";

            //" where nome=" + Rgblib.QStr(pParametro);

            SreDblib.ExecScript(script);
        }
        return(" ");
    }
Example #4
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 #5
0
    public static String AlteraContaSaldoInicial(string xID,
                                                 string xcod_conta,
                                                 string xdata,
                                                 string xdescricao,
                                                 string xcomplemento,
                                                 string xsaldo_i,
                                                 string xsaldo_aplicacaoD,
                                                 string xsaldo_aplicacaoB,
                                                 string xdtregistro)
    {
        string script = "UPDATE CONTAS_SALDO_INICIAL SET " +
                        " cod_conta = " + Srelib.QStr(xcod_conta) +
                        " ,data = " + Srelib.QStr(Srelib.DataAmericanasembarra(xdata)) +
                        " ,descricao = " + Srelib.QStr(xdescricao) +
                        " ,complemento = " + Srelib.QStr(xcomplemento) +
                        " ,saldo_i = " + Srelib.forcaponto(xsaldo_i) +
                        " ,saldo_aplicacaoD = " + Srelib.forcaponto(xsaldo_aplicacaoD) +
                        " ,saldo_aplicacaoB = " + Srelib.forcaponto(xsaldo_aplicacaoB) +
                        " ,dtregistro = " + Srelib.QStr(Srelib.DataAmericanasembarra(xdtregistro)) +
                        " where ID =" + xID;

        //revisar quando mexer na cobrança bancária

        SreDblib.ExecScript(script);

        return(" ");
    }
Example #6
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 #7
0
    public static String GravaSaldoInicial(string xcod_conta,
                                           string xdata,
                                           string xdescricao,
                                           string xcomplemento,
                                           string xsaldo_i,
                                           string xsaldo_aplicacaoD,
                                           string xsaldo_aplicacaoB,
                                           string xdtregistro)
    {
        if (xsaldo_i.Trim() == "")
        {
            xsaldo_i = "0.00";
        }

        if (xcod_conta != String.Empty)
        {
            string script = "INSERT INTO CONTAS_SALDO_INICIAL VALUES ( " +
                            Srelib.QStr(xcod_conta) +
                            ", " + Srelib.QStr(Srelib.DataAmericanasembarra(xdata)) +
                            ", " + Srelib.QStr(xdescricao) +
                            ", " + Srelib.QStr(xcomplemento) +
                            ", " + Srelib.forcaponto(xsaldo_i) +
                            ", " + Srelib.QStr(Srelib.DataAmericanasembarra(xdtregistro)) +
                            ", " + Srelib.forcaponto(xsaldo_aplicacaoD) +
                            ", " + Srelib.forcaponto(xsaldo_aplicacaoB) +
                            " ) ";

            SreDblib.ExecScript(script);
        }
        return(" ");
    }
Example #8
0
 public static String Grava(ref string xlancamento,
                            string xproduto,
                            string xclasse,
                            string xfornecedor,
                            string xdescricao,
                            string xdtprevista,
                            decimal xvlr_previsto,
                            string xdtrealizado,
                            decimal xvlr_realizado,
                            string xconta,
                            string xdocumento,
                            string xdtdocumento,
                            string xcheque,
                            string xcmc7,
                            string xdtcompensacao,
                            int xcontabil,
                            string xintegracao_contabil,
                            string xpedido_compra,
                            string xgrupo,
                            int xnominal)
 {
     //
     if (xlancamento != String.Empty)
     {
         //Check de Lançamento
         if (uContasPagar.LancamentoExiste(xlancamento))
         {
             xlancamento = uContasPagar.PegaNovoCodigoCPagar();
         }
         //
         string script = "INSERT INTO CONTAS_PAGAR VALUES ( " +
                         Srelib.QStr(xlancamento) +
                         ", " + Srelib.QStr(xproduto) +
                         ", " + Srelib.QStr(xclasse) +
                         ", " + Srelib.QStr(xfornecedor) +
                         ", " + Srelib.QStr(xdescricao) +
                         ", " + Srelib.QStr(Srelib.DataAmericanasembarra(xdtprevista)) +
                         ", " + Srelib.forcaponto(Convert.ToString(xvlr_previsto)) +
                         ", " + Srelib.QStr(Srelib.DataAmericanasembarra(xdtrealizado)) +
                         ", " + Srelib.forcaponto(Convert.ToString(xvlr_realizado)) +
                         ", " + Srelib.QStr(xconta) +
                         ", " + Srelib.QStr(xdocumento) +
                         ", " + Srelib.QStr(Srelib.DataAmericanasembarra(xdtdocumento)) +
                         ", " + Srelib.QStr(xcheque) +
                         ", " + Srelib.QStr(xcmc7) +
                         ", " + Srelib.QStr(Srelib.DataAmericanasembarra(xdtcompensacao)) +
                         ", " + Convert.ToString(xcontabil) +
                         ", " + Srelib.QStr(xintegracao_contabil) +
                         ", " + Srelib.QStr(xpedido_compra) +
                         ", " + Srelib.QStr(xgrupo) +
                         ", " + Convert.ToString(xnominal) +
                         " ) ";
         //
         SreDblib.ExecScript(script);
     }
     return(" ");
 }
Example #9
0
    public static String Grava(string xlancamento,
                               string xproduto,
                               string xclasse,
                               string xcliente,
                               string xdescricao,
                               string xdtprevista,
                               decimal xvlr_previsto,
                               string xdtrealizado,
                               decimal xvlr_realizado,
                               string xconta,
                               string xdocumento,
                               string xdtdocumento,
                               string xcheque,
                               string xcmc7,
                               string xdtcompensacao,
                               int xcontabil,
                               string xintegracao_contabil)
    {
        if (xlancamento != String.Empty)
        {
            //Check de Lançamento
            if (uContasReceber.LancamentoExiste(xlancamento))
            {
                xlancamento = uContasReceber.PegaNovoCodigoCReceber();
            }
            //
            string script = "INSERT INTO CONTAS_RECEBER VALUES ( " +
                            Srelib.QStr(xlancamento) +
                            ", " + Srelib.QStr(xproduto) +
                            ", " + Srelib.QStr(xclasse) +
                            ", " + Srelib.QStr(xcliente) +
                            ", " + Srelib.QStr(xdescricao) +
                            ", " + Srelib.QStr(Srelib.DataAmericanasembarra(xdtprevista)) +
                            ", " + Srelib.forcaponto(Convert.ToString(xvlr_previsto)) +
                            ", " + Srelib.QStr(Srelib.DataAmericanasembarra(xdtrealizado)) +
                            ", " + Srelib.forcaponto(Convert.ToString(xvlr_realizado)) +
                            ", " + Srelib.QStr(xconta) +
                            ", " + Srelib.QStr(xdocumento) +
                            ", " + Srelib.QStr(Srelib.DataAmericanasembarra(xdtdocumento)) +
                            ", " + Srelib.QStr(xcheque) +
                            ", " + Srelib.QStr(xcmc7) +
                            ", " + Srelib.QStr(Srelib.DataAmericanasembarra(xdtcompensacao)) +
                            ", " + Convert.ToString(xcontabil) +
                            ", " + Srelib.QStr(xintegracao_contabil) +
                            " ) ";

            //" where nome=" + Rgblib.QStr(pParametro);

            SreDblib.ExecScript(script);
        }
        return(" ");
    }
Example #10
0
    public static String AlteraCompensacao(string xID,
                                           string xdtcompensacao)
    {
        if (xID != String.Empty)
        {
            string script = "UPDATE CONTAS_PAGAR SET " +
                            " dtcompensacao = " + Srelib.QStr(Srelib.DataAmericanasembarra(xdtcompensacao)) +
                            " where ID = " + Srelib.QStr(xID);

            SreDblib.ExecScript(script);
        }
        return(" ");
    }
Example #11
0
    public static Double PegaDadosTaxasMensaisNomeString(String xNome, DateTime xPrevisao1, DateTime xPrevisao2)
    {
        string   script;
        DataSet  dsTaxasMensais;
        DateTime Previsao3;

        //xPrevisao1 = Convert.ToDateTime("01/" + xPrevisao1.Month + "/" + xPrevisao1.Year);
        xPrevisao1 = Convert.ToDateTime("01/" + Convert.ToString(xPrevisao1).Substring(3, 7));
        xPrevisao2 = Convert.ToDateTime("01/" + Convert.ToString(xPrevisao2).Substring(3, 7));
        Previsao3  = xPrevisao2;
        xPrevisao2 = xPrevisao2.AddMonths(1);
        xPrevisao2 = xPrevisao2.AddDays(-1);


        if (xNome != "NENHUM")
        {
            if (xPrevisao1 != Previsao3)
            {
                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) ";

                dsTaxasMensais = SreDblib.GetDsScript(script);

                Double Taxa_acumulada = 1;

                for (int i = 0; i < dsTaxasMensais.Tables[0].Rows.Count; i++)
                {
                    Taxa_acumulada = ((Convert.ToDouble(dsTaxasMensais.Tables[0].Rows[i][xNome].ToString().Trim()) / 100) + 1);
                }

                Taxa_acumulada = ((Taxa_acumulada - 1) * 100);

                return(Taxa_acumulada);
            }
            else
            {
                //Não a Acumulo de taxas para mesmo mês e Ano, metodo apenas para pegar taxa do mês
                return(0);
            }
        }
        else
        {
            //Não a Acumulo de taxas para mesmo mês e Ano, Não Acumular taxa NENHUM
            return(0);
        }
    }
Example #12
0
    public static String Altera(string xlancamento,
                                string xproduto,
                                string xclasse,
                                string xfornecedor,
                                string xdescricao,
                                string xdtprevista,
                                decimal xvlr_previsto,
                                string xdtrealizado,
                                decimal xvlr_realizado,
                                string xconta,
                                string xdocumento,
                                string xdtdocumento,
                                string xcheque,
                                string xcmc7,
                                string xdtcompensacao,
                                int xcontabil,
                                string xintegracao_contabil,
                                string xpedido_compra,
                                string xgrupo,
                                int xnominal)
    {
        if (xlancamento != String.Empty)
        {
            string script = "UPDATE CONTAS_PAGAR SET " +
                            //" lancamento = " + Srelib.QStr(xlancamento) +
                            " produto = " + Srelib.QStr(xproduto) +
                            ", classe = " + Srelib.QStr(xclasse) +
                            ", fornecedor = " + Srelib.QStr(xfornecedor) +
                            ", descricao = " + Srelib.QStr(xdescricao) +
                            ", data_prevista = " + Srelib.QStr(Srelib.DataAmericanasembarra(xdtprevista)) +
                            ", vlr_previsto = " + Srelib.forcaponto(Convert.ToString(xvlr_previsto)) +
                            ", data_realizado = " + Srelib.QStr(Srelib.DataAmericanasembarra(xdtrealizado)) +
                            ", vlr_realizado = " + Srelib.forcaponto(Convert.ToString(xvlr_realizado)) +
                            ", conta = " + Srelib.QStr(xconta) +
                            ", documento = " + Srelib.QStr(xdocumento) +
                            ", data_documento = " + Srelib.QStr(Srelib.DataAmericanasembarra(xdtdocumento)) +
                            ", cheque = " + Srelib.QStr(xcheque) +
                            ", cmc7 = " + Srelib.QStr(xcmc7) +
                            ", dtcompensacao = " + Srelib.QStr(Srelib.DataAmericanasembarra(xdtcompensacao)) +
                            ", contabil = " + Convert.ToString(xcontabil) +
                            ", integracao_contabil = " + Srelib.QStr(xintegracao_contabil) +
                            ", pedido_compra = " + Srelib.QStr(xpedido_compra) +
                            ", grupo = " + Srelib.QStr(xgrupo) +
                            ", nominal = " + Convert.ToString(xnominal) +
                            "  where lancamento = " + Srelib.QStr(xlancamento);

            SreDblib.ExecScript(script);
        }
        return(" ");
    }
Example #13
0
    public static String Grava(DateTime xdata)
    {
        if (xdata != Convert.ToDateTime("01/01/1900"))
        {
            string script = "INSERT INTO TAXAS_DIARIAS VALUES ( " +
                            Srelib.QStr(Srelib.DataAmericanasembarra(Convert.ToString(xdata))) +
                            " ) ";

            //" where nome=" + Rgblib.QStr(pParametro);

            SreDblib.ExecScript(script);
        }
        return(" ");
    }
Example #14
0
    public static String IncluiTaxas(string xID,
                                     string xdata,
                                     string xstring_altera)
    {
        string script = "INSERT INTO TAXAS_DIARIAS VALUES (  " +
                        Srelib.QStr(Srelib.DataAmericanasembarra(xdata)) + ", " +
                        xstring_altera + " ) ";

        //" where not exists(select TAXAS_DIARIAS where mes =" + xmes + " and ano = " + xano +") ";

        SreDblib.ExecScript(script);

        return(" ");
    }
Example #15
0
    public static String GravaTaxa(DateTime xdata, string xnome, string xvalor)
    {
        if (xdata != Convert.ToDateTime("01/01/1900"))
        {
            string script = "UPDATE TAXAS_DIARIAS " +
                            "SET " + xnome + " = " + Srelib.forcaponto(xvalor) +
                            "WHERE DATA = " +
                            Srelib.QStr(Srelib.DataAmericanasembarra(Convert.ToString(xdata)));

            //" where nome=" + Rgblib.QStr(pParametro);

            SreDblib.ExecScript(script);
        }
        return(" ");
    }
Example #16
0
    public static DataSet PegaDadosContatoDevedores(string xcbproduto,
                                                    string xcbprodutogrupo,
                                                    string xdtprevisao1)
    {
        string script;

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

            script = script + " ORDER BY nome ";
        }
        else
        {
            script = "SELECT * FROM Contato C WHERE 1 = 1 ";
            //
            if (xcbproduto.Trim() != string.Empty)
            {
                //
                string nomearquivo = "parcelas_" + Srelib.QStr0(xcbproduto.Trim(), 5) + "_" + Srelib.QStr0(xcbprodutogrupo.Trim(), 5);
                //
                script = script + " AND exists(SELECT * FROM " + nomearquivo + " P WHERE 1 = 1 ";
                script = script + " AND P.DATA_VENCIMENTO <= " + Srelib.QStr(Srelib.DataAmericanasembarra(xdtprevisao1)) +
                         " AND P.DATA_PAGAMENTO = " + Srelib.QStr(Srelib.DataAmericanasembarra("01/01/1900"));
                script = script + " ) ";
                //
            }

            script = script + " ORDER BY C.nome ";
        }

        return(SreDblib.GetDsScript(script));
    }
Example #17
0
    public static String ExcluiLancamentos(string xcodigoconta,
                                           string xdtperiodo1,
                                           string xdtperiodo2)
    {
        string nomeconta = "conta_" + Srelib.QStr0(xcodigoconta.Trim(), 5);
        //

        string script = "DELETE " + nomeconta + " where " +
                        " (data between " + Srelib.QStr(Srelib.DataAmericanasembarra(xdtperiodo1)) +
                        " and " + Srelib.QStr(Srelib.DataAmericanasembarra(xdtperiodo2)) + " ) ";



        SreDblib.ExecScript(script);

        return(" ");
    }
Example #18
0
    public static String GravaCompensacao(string xlancamento,
                                          string xdtcompensacao,
                                          string xnumerocheque)
    {
        if (xlancamento != String.Empty)
        {
            string script = "UPDATE CONTAS_PAGAR SET " +
                            " dtcompensacao = " + Srelib.QStr(Srelib.DataAmericanasembarra(xdtcompensacao)) +
                            " , cheque = " + Srelib.QStr(xnumerocheque) +
                            " , vlr_realizado = vlr_previsto " +
                            " , data_realizado = " + Srelib.QStr(Srelib.DataAmericanasembarra(xdtcompensacao)) +
                            " where lancamento = " + Srelib.QStr(xlancamento);

            SreDblib.ExecScript(script);
        }
        return(" ");
    }
Example #19
0
    public static String GravaLancamento(string xcodigo_conta,
                                         string xlancamento,
                                         string xproduto,
                                         string xclasse,
                                         string xpedido_compra,
                                         string xdata,
                                         string xdescricao,
                                         string xcomplemento,
                                         string xsaldo_i,
                                         string xcredito,
                                         string xdebito,
                                         string xsaldo_f,
                                         string xsaldo_aplicacaoD,
                                         string xsaldo_aplicacaoB,
                                         string xsaldo_total,
                                         string xcheque,
                                         string xcmc7,
                                         string xdtregistro)
    {
        if (xcodigo_conta != String.Empty)
        {
            string script = "INSERT INTO conta_" + Srelib.QStr0(xcodigo_conta.Trim(), 5) + " VALUES ( " +
                            Srelib.QStr(xcodigo_conta) +
                            ", " + Srelib.QStr(xlancamento) +
                            ", " + Srelib.QStr(xproduto) +
                            ", " + Srelib.QStr(xclasse) +
                            ", " + Srelib.QStr(xpedido_compra) +
                            ", " + Srelib.QStr(Srelib.DataAmericanasembarra(xdata)) +
                            ", " + Srelib.QStr(xdescricao) +
                            ", " + Srelib.QStr(xcomplemento) +
                            ", " + Srelib.forcaponto(xsaldo_i) +
                            ", " + Srelib.forcaponto(xcredito) +
                            ", " + Srelib.forcaponto(xdebito) +
                            ", " + Srelib.forcaponto(xsaldo_f) +
                            ", " + Srelib.forcaponto(xsaldo_aplicacaoD) +
                            ", " + Srelib.forcaponto(xsaldo_aplicacaoB) +
                            ", " + Srelib.forcaponto(xsaldo_total) +
                            ", " + Srelib.QStr(xcheque) +
                            ", " + Srelib.QStr(xcmc7) +
                            ", " + Srelib.QStr(Srelib.DataAmericanasembarra(xdtregistro)) +
                            " ) ";

            SreDblib.ExecScript(script);
        }
        return(" ");
    }
Example #20
0
    public static String AlteraGrupo(string xID,
                                     string xproduto,
                                     string xgrupo,
                                     string xgrupo_tipo,
                                     string xdescricao,
                                     string xquantidade,
                                     string xnum_inicial,
                                     string xnum_final,
                                     Boolean xativo,
                                     DateTime xdtbase_vlr_venda,
                                     string xvlr_venda,
                                     string xobserva_1,
                                     string xobserva_2)
    {
        if (xdescricao != String.Empty)
        {
            if (xvlr_venda == String.Empty)
            {
                xvlr_venda = "0";
            }

            string script = "UPDATE PRODUTO_GRUPO SET " +
                            " produto = " + Srelib.QStr(xproduto) +
                            " ,grupo = " + Srelib.QStr(xgrupo) +
                            " ,grupo_tipo = " + Srelib.QStr(xgrupo_tipo) +
                            " ,descricao = " + Srelib.QStr(xdescricao) +
                            " ,quantidade = " + xquantidade +
                            " ,num_inicio = " + xnum_inicial +
                            " ,num_final = " + xnum_final +
                            " ,ativo = " + Convert.ToString(Convert.ToInt16(xativo)) +
                            " ,dtbase_vlr_venda = " + Srelib.QStr(Srelib.DataAmericanasembarra(Convert.ToString(xdtbase_vlr_venda))) +
                            " ,vlr_venda = " + Srelib.forcaponto(xvlr_venda) +
                            " ,observa_1 = " + Srelib.QStr(xobserva_1) +
                            " ,observa_2 = " + Srelib.QStr(xobserva_2) +
                            " where ID =" + xID;


            //" where nome=" + Rgblib.QStr(pParametro);

            SreDblib.ExecScript(script);
        }
        return(" ");
    }
Example #21
0
    public static String PegaChequesCompensados(string xcodigoconta,
                                                string xdtprevisao1,
                                                string xdtprevisao2,
                                                Boolean xcompensado)
    {
        string script = "select SUM(vlr_previsto) total from contas_pagar " +
                        " with(nolock) " +
                        " where conta = " + Srelib.QStr(xcodigoconta);

        script = script +
                 " AND " +
                 " (data_prevista >= " + Srelib.QStr(Srelib.DataAmericanasembarra(xdtprevisao1)) +
                 " and data_prevista <= " + Srelib.QStr(Srelib.DataAmericanasembarra(xdtprevisao2)) + ") ";
        //Compensado
        if (xcompensado)
        {
            //Compensado
            script = script + " AND ";
            script = script + " (dtcompensacao <> " + Srelib.QStr(Srelib.DataAmericanasembarra("01/01/1900")) + ") ";
        }
        else
        {
            //Não Compensado
            script = script + " AND ";
            script = script + " (dtcompensacao = " + Srelib.QStr(Srelib.DataAmericanasembarra("01/01/1900")) + ") ";
        }

        string retorno = "0.00";

        try
        {
            retorno = SreDblib.GetCampoScript(script);
            if (retorno == "")
            {
                retorno = "0.00";
            }
        }
        catch (Exception)
        {
            retorno = "0.00";
        }
        return(retorno);
    }
Example #22
0
    public static DataSet PegaDadosLog(string xusuario,
                                       string xData1,
                                       string xData2,
                                       string xModulo,
                                       string xAcao,
                                       string xComplementoAcao)
    {
        //Pega Log
        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)) + ") ";
        }

        if (xModulo != "")
        {
            script = script + " and (operacao = " + Srelib.QStr(xModulo) + ") ";
        }

        if (xAcao != "")
        {
            script = script + " and (obs <= " + Srelib.QStr(xAcao) + ") ";
        }

        if (xComplementoAcao != "")
        {
            script = script + " and (acao like " + Srelib.QStr("%" + xComplementoAcao + "%") + ") ";
        }

        script = script + " order by DataHora";

        return(SreDblib.GetDsScript(script));
    }
Example #23
0
    public static Double PegaDadosTaxasMensaisAcumuladaNome(String xNome, DateTime xPrevisao1, DateTime xPrevisao2)
    {
        //Calculo para Correção Mensal
        string  script;
        DataSet dsTaxasMensais;

        //
        xPrevisao1 = Convert.ToDateTime("01/" + Convert.ToString(xPrevisao1).Substring(3, 7));
        //xPrevisao2 = Convert.ToDateTime("01/" + Convert.ToString(xPrevisao2).Substring(3, 7));
        //
        if (xNome != "NENHUM")
        {
            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) ";


            dsTaxasMensais = SreDblib.GetDsScript(script);

            Double Taxa_acumulada = 1;

            for (int i = 0; i < dsTaxasMensais.Tables[0].Rows.Count; i++)
            {
                Taxa_acumulada = Taxa_acumulada *
                                 ((Convert.ToDouble(dsTaxasMensais.Tables[0].Rows[i][xNome].ToString().Trim()) / 100) + 1);
            }
            //
            Taxa_acumulada = ((Taxa_acumulada - 1) * 100);

            return(Taxa_acumulada);
        }
        else
        {
            //Não a Acumulo de taxas para taxa NENHUM
            return(0);
        }
    }
Example #24
0
    public static DataSet PegaDadosTaxasDiariasNome(String xNome, DateTime xPrevisao1, DateTime xPrevisao2)
    {
        string script;

        if (xNome == "")
        {
            script = " SELECT * FROM taxas_diarias WITH(NOLOCK) " +
                     " WHERE (data >= " + Srelib.QStr(Srelib.DataAmericanasembarra(Convert.ToString(xPrevisao1))) +
                     " and data <= " + Srelib.QStr(Srelib.DataAmericanasembarra(Convert.ToString(xPrevisao2))) + ") " +
                     " order by data";
        }
        else
        {
            script = "SELECT data," + xNome + " FROM taxas_diarias WITH(NOLOCK) " +
                     " WHERE (data >= " + Srelib.QStr(Srelib.DataAmericanasembarra(Convert.ToString(xPrevisao1))) +
                     " and data <= " + Srelib.QStr(Srelib.DataAmericanasembarra(Convert.ToString(xPrevisao2))) + ") " +
                     " order by data";
        }

        return(SreDblib.GetDsScript(script));
    }
Example #25
0
    public static DataSet PegaDadosTaxasDiariasID(Int32 xID, DateTime xPrevisao1, DateTime xPrevisao2)
    {
        string script;

        if (xID == 0)
        {
            script = " SELECT * FROM taxas_diarias WITH(NOLOCK) " +
                     " WHERE (data >= " + Srelib.QStr(Srelib.DataAmericanasembarra(Convert.ToString(xPrevisao1))) +
                     " and data <= " + Srelib.QStr(Srelib.DataAmericanasembarra(Convert.ToString(xPrevisao2))) + ") " +
                     " order by data";
        }
        else
        {
            script = "SELECT * FROM taxas_diarias WITH(NOLOCK) WHERE id = " + Convert.ToString(xID) +
                     " AND (data >= " + Srelib.QStr(Srelib.DataAmericanasembarra(Convert.ToString(xPrevisao1))) +
                     " and data <= " + Srelib.QStr(Srelib.DataAmericanasembarra(Convert.ToString(xPrevisao2))) + ") " +
                     " order by data";
        }

        return(SreDblib.GetDsScript(script));
    }
Example #26
0
    public static String GravaGrupo(string xproduto,
                                    string xgrupo,
                                    string xgrupo_tipo,
                                    string xdescricao,
                                    string xquantidade,
                                    string xnum_inicial,
                                    string xnum_final,
                                    Boolean xativo,
                                    DateTime xdtbase_vlr_venda,
                                    string xvlr_venda,
                                    string xobserva_1,
                                    string xobserva_2)
    {
        if (xdescricao != String.Empty)
        {
            if (xvlr_venda == String.Empty)
            {
                xvlr_venda = "0";
            }

            string script = "INSERT INTO PRODUTO_GRUPO VALUES ( " +
                            Srelib.QStr(xproduto) +
                            ", " + Srelib.QStr(xgrupo) +
                            ", " + Srelib.QStr(xgrupo_tipo) +
                            ", " + Srelib.QStr(xdescricao) +
                            ", " + xquantidade +
                            ", " + xnum_inicial +
                            ", " + xnum_final +
                            ", " + Convert.ToString(Convert.ToInt16(xativo)) +
                            ", " + Srelib.QStr(Srelib.DataAmericanasembarra(Convert.ToString(xdtbase_vlr_venda))) +
                            ", " + Srelib.forcaponto(xvlr_venda) +
                            ", " + Srelib.QStr(xobserva_1) +
                            ", " + Srelib.QStr(xobserva_2) +
                            " ) ";

            SreDblib.ExecScript(script);
        }
        return(" ");
    }
Example #27
0
    public static DataSet PegaDadosConta(string xcodigoconta,
                                         string xdataini,
                                         string xdatafim)
    {
        string script      = "";
        string nomearquivo = "conta_" + Srelib.QStr0(xcodigoconta.Trim(), 5);

        script = "SELECT *, (saldo_f+saldo_aplicacaoD+saldo_aplicacaoB) saldo_finalaplicacao FROM " + nomearquivo + " WITH(NOLOCK) ";
        script = script + " WHERE ";
        //Conta
        script = script + " ( cod_conta = " + Srelib.QStr(xcodigoconta) + ") ";
        //Data Prevista
        script = script + " AND ";
        script = script + " (data between " + Srelib.QStr(Srelib.DataAmericanasembarra(xdataini)) + " and " +
                 Srelib.QStr(Srelib.DataAmericanasembarra(xdatafim)) + ") ";
        //script = script + " (data >= " + Srelib.QStr(Srelib.DataAmericanasembarra(xdataini));
        //script = script + " and data <= " + Srelib.QStr(Srelib.DataAmericanasembarra(xdatafim)) + ") ";

        //Data Nota Fiscal
        script = script + " order by data ";


        return(SreDblib.GetDsScript(script));
    }
Example #28
0
    public static String Grava(string xcodigo,
                               string xapelido,
                               string xnome,
                               string xsexo,
                               string xcnpj,
                               string xinscmunicipal,
                               string xinscestadual,
                               string xregjuntacom,
                               string xnire,
                               string rg,
                               string rguf,
                               string rgemissor,
                               DateTime rgemissao,
                               string xenderecocom,
                               string xenderecocomnumero,
                               string xenderecocomcomplem,
                               string xbairrocom,
                               string xcidadecom,
                               string xufcom,
                               string xcepcom,
                               string xfone1com,
                               string xfone2com,
                               string xfone3com,
                               string xemail1,
                               string xemail2,
                               string xemail3,
                               string xemail4,
                               string xemail5,
                               string xgerente,
                               string xcontato,
                               DateTime xdtnascimento,
                               DateTime xdtingresso,
                               string xncontrato,
                               DateTime xdtcontrato,
                               Boolean xativo,
                               Boolean xacessointernet,
                               string xobs1,
                               string xobs2,
                               string xobs3,
                               string xobs4,
                               string xobs5,
                               string xinstrcob1,
                               string xinstrcob2,
                               string xdiasprotesto,
                               string xconta1,
                               string xconta2,
                               string xconta3,
                               string xconta4,
                               string xconta5
                               )
    {
        if (xapelido != String.Empty)
        {
            string script = "INSERT INTO CLIENTES VALUES ( " +
                            xcodigo +
                            ", " + Srelib.QStr(xapelido) +
                            ", " + Srelib.QStr(xnome) +
                            ", " + Srelib.QStr(xsexo) +
                            ", " + Srelib.QStr(xcnpj) +
                            ", " + Srelib.QStr(xinscmunicipal) +
                            ", " + Srelib.QStr(xinscestadual) +
                            ", " + Srelib.QStr(xregjuntacom) +
                            ", " + Srelib.QStr(xnire) +
                            ", " + Srelib.QStr(rg) +
                            ", " + Srelib.QStr(rguf) +
                            ", " + Srelib.QStr(rgemissor) +
                            ", " + Srelib.QStr(Srelib.DataAmericanasembarra(Convert.ToString(rgemissao))) +
                            ", " + Srelib.QStr(xenderecocom) +
                            ", " + Srelib.QStr(xenderecocomnumero) +
                            ", " + Srelib.QStr(xenderecocomcomplem) +
                            ", " + Srelib.QStr(xbairrocom) +
                            ", " + Srelib.QStr(xcidadecom) +
                            ", " + Srelib.QStr(xufcom) +
                            ", " + Srelib.QStr(xcepcom) +
                            ", " + Srelib.QStr(xfone1com) +
                            ", " + Srelib.QStr(xfone2com) +
                            ", " + Srelib.QStr(xfone3com) +
                            ", " + Srelib.QStr(xemail1) +
                            ", " + Srelib.QStr(xemail2) +
                            ", " + Srelib.QStr(xemail3) +
                            ", " + Srelib.QStr(xemail4) +
                            ", " + Srelib.QStr(xemail5) +
                            ", " + Srelib.QStr(xgerente) +
                            ", " + Srelib.QStr(xcontato) +
                            ", " + Srelib.QStr(Srelib.DataAmericanasembarra(Convert.ToString(xdtnascimento))) +
                            ", " + Srelib.QStr(Srelib.DataAmericanasembarra(Convert.ToString(xdtingresso))) +
                            ", " + Srelib.QStr(xncontrato) +
                            ", " + Srelib.QStr(Srelib.DataAmericanasembarra(Convert.ToString(xdtcontrato))) +
                            ", " + Convert.ToString(Convert.ToInt16(xativo)) +
                            ", " + Convert.ToString(Convert.ToInt16(xacessointernet)) +
                            ", " + Srelib.QStr(xobs1) +
                            ", " + Srelib.QStr(xobs2) +
                            ", " + Srelib.QStr(xobs3) +
                            ", " + Srelib.QStr(xobs4) +
                            ", " + Srelib.QStr(xobs5) +
                            ", " + Srelib.QStr(xinstrcob1) +
                            ", " + Srelib.QStr(xinstrcob2) +
                            ", " + Srelib.QStr(xdiasprotesto) +
                            ", " + Srelib.QStr(xconta1) +
                            ", " + Srelib.QStr(xconta2) +
                            ", " + Srelib.QStr(xconta3) +
                            ", " + Srelib.QStr(xconta4) +
                            ", " + Srelib.QStr(xconta5) +
                            " ) ";

            //" where nome=" + Rgblib.QStr(pParametro);

            SreDblib.ExecScript(script);
        }
        return(" ");
    }
Example #29
0
    public static String Grava(string xproposta,
                               string xdata_proposta,
                               string xproduto,
                               string xgrupo,
                               string xunidade,
                               string xparte,
                               string xtipoplanta,
                               string xindexadorprehabitese,
                               string xindexadorposhabitese,
                               string xjurosposhabitese,
                               string xcliente,
                               string xsexo,
                               string xcnpj,
                               string xinscmunicipal,
                               string xinscestadual,
                               string xregjuntacom,
                               string xnire,
                               string xrg,
                               string xrguf,
                               string xrgemissor,
                               string xrgemissao,
                               string xestadocivil,
                               string xregimecasamento,
                               string xnacionalidade,
                               string xprofissao,
                               string xemail1,
                               string xemail2,
                               string xemail3,
                               string xdtnascimento,
                               string xconjugenome,
                               string xconjugesexo,
                               string xconjugecpf,
                               string xconjugerg,
                               string xconjugerguf,
                               string xconjugergemissor,
                               string xconjugergemissao,
                               string xconjugenacionalidade,
                               string xconjugeprofissao,
                               string xconjugeemail1,
                               string xconjugeemail2,
                               string xconjugeemail3,
                               string xconjugedtnascimento,
                               string xendereco,
                               string xenderecores,
                               string xenderecoresnumero,
                               string xenderecorescomplem,
                               string xbairrores,
                               string xcidaderes,
                               string xufres,
                               string xcepres,
                               string xfone1res,
                               string xfone2res,
                               string xfone3res,
                               string xenderecocom,
                               string xenderecocomnumero,
                               string xenderecocomcomplem,
                               string xbairrocom,
                               string xcidadecom,
                               string xufcom,
                               string xcepcom,
                               string xfone1com,
                               string xfone2com,
                               string xfone3com,
                               string xativo,
                               Decimal xcomissaopermanencia,
                               string xtabelaprice,
                               Decimal xvalor_venda,
                               Decimal xsinal,
                               Decimal xsaldo,
                               string xplano1_parcelas_qtd,
                               Decimal xplano1_parcelas_vlr,
                               string xplano1_parcelas_vencimento,
                               string xplano2_parcelas_qtd,
                               Decimal xplano2_parcelas_vlr,
                               string xplano2_parcelas_vencimento,
                               string xplano3_parcelas_qtd,
                               Decimal xplano3_parcelas_vlr,
                               string xplano3_parcelas_vencimento,
                               string xplano4_parcelas_qtd,
                               Decimal xplano4_parcelas_vlr,
                               string xplano4_parcelas_vencimento,
                               string xplano5_parcelas_qtd,
                               Decimal xplano5_parcelas_vlr,
                               string xplano5_parcelas_vencimento,
                               string xplano6_parcelas_qtd,
                               Decimal xplano6_parcelas_vlr,
                               string xplano6_parcelas_vencimento,
                               string xplano7_parcelas_qtd,
                               Decimal xplano7_parcelas_vlr,
                               string xplano7_parcelas_vencimento,
                               string xplano8_parcelas_qtd,
                               Decimal xplano8_parcelas_vlr,
                               string xplano8_parcelas_vencimento,
                               string xobs,
                               string xcorretor)
    {
        string yproposta = ProximaProposta();

        //
        if (xproduto != String.Empty)
        {
            //
            string script = "INSERT INTO proposta VALUES ( " +
                            yproposta +
                            ", " + Srelib.QStr(Srelib.DataAmericanasembarra(xdata_proposta.ToString().Substring(0, 10))) +
                            ", " + xproduto +
                            ", " + xgrupo +
                            ", " + xunidade +
                            ", " + xparte +
                            ", " + Srelib.QStr(xtipoplanta) +
                            ", " + Srelib.QStr(xindexadorprehabitese) +
                            ", " + Srelib.QStr(xindexadorposhabitese) +
                            ", " + Srelib.QStr(xjurosposhabitese) +
                            ", " + Srelib.QStr(xcliente) +
                            ", " + Srelib.QStr(xsexo) +
                            ", " + Srelib.QStr(xcnpj) +
                            ", " + Srelib.QStr(xinscmunicipal) +
                            ", " + Srelib.QStr(xinscestadual) +
                            ", " + Srelib.QStr(xregjuntacom) +
                            ", " + Srelib.QStr(xnire) +
                            ", " + Srelib.QStr(xrg) +
                            ", " + Srelib.QStr(xrguf) +
                            ", " + Srelib.QStr(xrgemissor) +
                            ", " + Srelib.QStr(Srelib.DataAmericanasembarra(xrgemissao.ToString().Substring(0, 10))) +
                            ", " + Srelib.QStr(xestadocivil) +
                            ", " + Srelib.QStr(xregimecasamento) +
                            ", " + Srelib.QStr(xnacionalidade) +
                            ", " + Srelib.QStr(xprofissao) +
                            ", " + Srelib.QStr(xemail1) +
                            ", " + Srelib.QStr(xemail2) +
                            ", " + Srelib.QStr(xemail3) +
                            ", " + Srelib.QStr(Srelib.DataAmericanasembarra(xdtnascimento.ToString().Substring(0, 10))) +
                            ", " + Srelib.QStr(xconjugenome) +
                            ", " + Srelib.QStr(xconjugesexo) +
                            ", " + Srelib.QStr(xconjugecpf) +
                            ", " + Srelib.QStr(xconjugerg) +
                            ", " + Srelib.QStr(xconjugerguf) +
                            ", " + Srelib.QStr(xconjugergemissor) +
                            ", " + Srelib.QStr(Srelib.DataAmericanasembarra(xconjugergemissao.ToString().Substring(0, 10))) +
                            ", " + Srelib.QStr(xconjugenacionalidade) +
                            ", " + Srelib.QStr(xconjugeprofissao) +
                            ", " + Srelib.QStr(xconjugeemail1) +
                            ", " + Srelib.QStr(xconjugeemail2) +
                            ", " + Srelib.QStr(xconjugeemail3) +
                            ", " + Srelib.QStr(Srelib.DataAmericanasembarra(xconjugedtnascimento.ToString().Substring(0, 10))) +
                            ", " + Srelib.QStr(xendereco) +
                            ", " + Srelib.QStr(xenderecores) +
                            ", " + Srelib.QStr(xenderecoresnumero) +
                            ", " + Srelib.QStr(xenderecorescomplem) +
                            ", " + Srelib.QStr(xbairrores) +
                            ", " + Srelib.QStr(xcidaderes) +
                            ", " + Srelib.QStr(xufres) +
                            ", " + Srelib.QStr(xcepres) +
                            ", " + Srelib.QStr(xfone1res) +
                            ", " + Srelib.QStr(xfone2res) +
                            ", " + Srelib.QStr(xfone3res) +
                            ", " + Srelib.QStr(xenderecocom) +
                            ", " + Srelib.QStr(xenderecocomnumero) +
                            ", " + Srelib.QStr(xenderecocomcomplem) +
                            ", " + Srelib.QStr(xbairrocom) +
                            ", " + Srelib.QStr(xcidadecom) +
                            ", " + Srelib.QStr(xufcom) +
                            ", " + Srelib.QStr(xcepcom) +
                            ", " + Srelib.QStr(xfone1com) +
                            ", " + Srelib.QStr(xfone2com) +
                            ", " + Srelib.QStr(xfone3com) +
                            ", " + xativo +
                            ", " + Srelib.forcaponto(Convert.ToString(xcomissaopermanencia)) +
                            ", " + xtabelaprice +
                            ", " + Srelib.forcaponto(Convert.ToString(xvalor_venda)) +
                            ", " + Srelib.forcaponto(Convert.ToString(xsinal)) +
                            ", " + Srelib.forcaponto(Convert.ToString(xsaldo)) +
                            ", " + Srelib.forcaponto(Convert.ToString(xplano1_parcelas_qtd)) +
                            ", " + Srelib.forcaponto(Convert.ToString(xplano1_parcelas_vlr)) +
                            ", " + Srelib.QStr(Srelib.DataAmericanasembarra(xplano1_parcelas_vencimento.ToString().Substring(0, 10))) +
                            ", " + Srelib.forcaponto(Convert.ToString(xplano2_parcelas_qtd)) +
                            ", " + Srelib.forcaponto(Convert.ToString(xplano2_parcelas_vlr)) +
                            ", " + Srelib.QStr(Srelib.DataAmericanasembarra(xplano2_parcelas_vencimento.ToString().Substring(0, 10))) +
                            ", " + Srelib.forcaponto(Convert.ToString(xplano3_parcelas_qtd)) +
                            ", " + Srelib.forcaponto(Convert.ToString(xplano3_parcelas_vlr)) +
                            ", " + Srelib.QStr(Srelib.DataAmericanasembarra(xplano3_parcelas_vencimento.ToString().Substring(0, 10))) +
                            ", " + Srelib.forcaponto(Convert.ToString(xplano4_parcelas_qtd)) +
                            ", " + Srelib.forcaponto(Convert.ToString(xplano4_parcelas_vlr)) +
                            ", " + Srelib.QStr(Srelib.DataAmericanasembarra(xplano4_parcelas_vencimento.ToString().Substring(0, 10))) +
                            ", " + Srelib.forcaponto(Convert.ToString(xplano5_parcelas_qtd)) +
                            ", " + Srelib.forcaponto(Convert.ToString(xplano5_parcelas_vlr)) +
                            ", " + Srelib.QStr(Srelib.DataAmericanasembarra(xplano5_parcelas_vencimento.ToString().Substring(0, 10))) +
                            ", " + Srelib.forcaponto(Convert.ToString(xplano6_parcelas_qtd)) +
                            ", " + Srelib.forcaponto(Convert.ToString(xplano6_parcelas_vlr)) +
                            ", " + Srelib.QStr(Srelib.DataAmericanasembarra(xplano6_parcelas_vencimento.ToString().Substring(0, 10))) +
                            ", " + Srelib.forcaponto(Convert.ToString(xplano7_parcelas_qtd)) +
                            ", " + Srelib.forcaponto(Convert.ToString(xplano7_parcelas_vlr)) +
                            ", " + Srelib.QStr(Srelib.DataAmericanasembarra(xplano7_parcelas_vencimento.ToString().Substring(0, 10))) +
                            ", " + Srelib.forcaponto(Convert.ToString(xplano8_parcelas_qtd)) +
                            ", " + Srelib.forcaponto(Convert.ToString(xplano8_parcelas_vlr)) +
                            ", " + Srelib.QStr(Srelib.DataAmericanasembarra(xplano8_parcelas_vencimento.ToString().Substring(0, 10))) +
                            ", " + Srelib.QStr(xobs) +
                            ", " + xcorretor +
                            ")";

            SreDblib.ExecScript(script);
        }
        return(" ");
    }
Example #30
0
    public static String Altera(string xID,
                                string xapelido,
                                string xnome,
                                string xsexo,
                                string xcnpj,
                                string xinscmunicipal,
                                string xinscestadual,
                                string xregjuntacom,
                                string xnire,
                                string xrg,
                                string xrguf,
                                string xrgemissor,
                                DateTime xrgemissao,
                                string xenderecocom,
                                string xenderecocomnumero,
                                string xenderecocomcomplem,
                                string xbairrocom,
                                string xcidadecom,
                                string xufcom,
                                string xcepcom,
                                string xfone1com,
                                string xfone2com,
                                string xfone3com,
                                string xemail1,
                                string xemail2,
                                string xemail3,
                                string xemail4,
                                string xemail5,
                                string xgerente,
                                string xcontato,
                                DateTime xdtnascimento,
                                DateTime xdtingresso,
                                string xncontrato,
                                DateTime xdtcontrato,
                                Boolean xativo,
                                Boolean xacessointernet,
                                string xobs1,
                                string xobs2,
                                string xobs3,
                                string xobs4,
                                string xobs5,
                                string xinstrcob1,
                                string xinstrcob2,
                                string xdiasprotesto,
                                string xconta1,
                                string xconta2,
                                string xconta3,
                                string xconta4,
                                string xconta5
                                )
    {
        string script = "UPDATE CLIENTES SET " +
                        " apelido = " + Srelib.QStr(xapelido) +
                        " ,nome = " + Srelib.QStr(xnome) +
                        " ,sexo = " + Srelib.QStr(xsexo) +
                        " ,cnpj = " + Srelib.QStr(xcnpj) +
                        " ,inscmunicipal = " + Srelib.QStr(xinscmunicipal) +
                        " ,inscestadual = " + Srelib.QStr(xinscestadual) +
                        " ,regjuntacom = " + Srelib.QStr(xregjuntacom) +
                        " ,nire = " + Srelib.QStr(xnire) +
                        " ,rg = " + Srelib.QStr(xrg) +
                        " ,rguf = " + Srelib.QStr(xrguf) +
                        " ,rgemissor = " + Srelib.QStr(xrgemissor) +
                        " ,rgemissao = " + Srelib.QStr(Srelib.DataAmericanasembarra(Convert.ToString(xrgemissao))) +
                        " ,enderecocom = " + Srelib.QStr(xenderecocom) +
                        " ,enderecocomnumero = " + Srelib.QStr(xenderecocomnumero) +
                        " ,enderecocomcomplem = " + Srelib.QStr(xenderecocomcomplem) +
                        " ,bairrocom = " + Srelib.QStr(xbairrocom) +
                        " ,cidadecom = " + Srelib.QStr(xcidadecom) +
                        " ,ufcom = " + Srelib.QStr(xufcom) +
                        " ,cepcom = " + Srelib.QStr(xcepcom) +
                        " ,fone1com = " + Srelib.QStr(xfone1com) +
                        " ,fone2com = " + Srelib.QStr(xfone2com) +
                        " ,fone3com = " + Srelib.QStr(xfone3com) +
                        " ,email1 = " + Srelib.QStr(xemail1) +
                        " ,email2 = " + Srelib.QStr(xemail2) +
                        " ,email3 = " + Srelib.QStr(xemail3) +
                        " ,email4 = " + Srelib.QStr(xemail4) +
                        " ,email5 = " + Srelib.QStr(xemail5) +
                        " ,gerente = " + Srelib.QStr(xgerente) +
                        " ,contato = " + Srelib.QStr(xcontato) +
                        " ,dtnascimento = " + Srelib.QStr(Srelib.DataAmericanasembarra(Convert.ToString(xdtnascimento))) +
                        " ,dtingresso = " + Srelib.QStr(Srelib.DataAmericanasembarra(Convert.ToString(xdtingresso))) +
                        " ,ncontrato = " + Srelib.QStr(xncontrato) +
                        " ,dtcontrato = " + Srelib.QStr(Srelib.DataAmericanasembarra(Convert.ToString(xdtcontrato))) +
                        " ,ativo = " + Convert.ToString(Convert.ToInt16(xativo)) +
                        " ,acessointernet = " + Convert.ToString(Convert.ToInt16(xacessointernet)) +
                        " ,obs1 = " + Srelib.QStr(xobs1) +
                        " ,obs2 = " + Srelib.QStr(xobs2) +
                        " ,obs3 = " + Srelib.QStr(xobs3) +
                        " ,obs4 = " + Srelib.QStr(xobs4) +
                        " ,obs5 = " + Srelib.QStr(xobs5) +
                        " ,instrcob1 = " + Srelib.QStr(xinstrcob1) +
                        " ,instrcob2 = " + Srelib.QStr(xinstrcob2) +
                        " ,diasprotesto = " + Srelib.QStr(xdiasprotesto) +
                        " ,conta1 = " + Srelib.QStr(xconta1) +
                        " ,conta2 = " + Srelib.QStr(xconta2) +
                        " ,conta3 = " + Srelib.QStr(xconta3) +
                        " ,conta4 = " + Srelib.QStr(xconta4) +
                        " ,conta5 = " + Srelib.QStr(xconta5) +
                        " where ID =" + xID;

        SreDblib.ExecScript(script);

        return(" ");
    }