コード例 #1
0
    private void Detail_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
    {
        string TipoEndereco = Convert.ToString(GetCurrentColumnValue("endereco"));

        if (TipoEndereco == "R")
        {
            lendereco.Text = "Res: " + Convert.ToString(GetCurrentColumnValue("enderecores"));
            lbairro.Text   = Convert.ToString(GetCurrentColumnValue("bairrores"));
            lcidade.Text   = Convert.ToString(GetCurrentColumnValue("cidaderes"));
            luf.Text       = Convert.ToString(GetCurrentColumnValue("ufres"));
            lcep.Text      = Convert.ToString(GetCurrentColumnValue("cepres"));
            lcnpj.Text     = Srelib.FormataCPFCNPJ(Convert.ToString(GetCurrentColumnValue("cnpj")));
            lfone.Text     = Convert.ToString(GetCurrentColumnValue("fone1res"));
        }
        else
        {
            lendereco.Text = "Com: " + Convert.ToString(GetCurrentColumnValue("enderecocom"));
            lbairro.Text   = Convert.ToString(GetCurrentColumnValue("bairrocom"));
            lcidade.Text   = Convert.ToString(GetCurrentColumnValue("cidadecom"));
            luf.Text       = Convert.ToString(GetCurrentColumnValue("ufcom"));
            lcep.Text      = Convert.ToString(GetCurrentColumnValue("cepcom"));
            lcnpj.Text     = Srelib.FormataCPFCNPJ(Convert.ToString(GetCurrentColumnValue("cnpj")));
            lfone.Text     = Convert.ToString(GetCurrentColumnValue("fone1com"));
        }
        totquantidade++;
    }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if ((String)Session["IdSessao"] == null)
        {
            Session.Add("fimdesessao", "A Sessão foi expirada, reinicie o sistema!");
            Server.Transfer("~\\LoginTimeOut.aspx");
        }

        ScriptManager.RegisterStartupScript(this, typeof(string), "MAXIMIZE", "top.window.moveTo(0,0); top.window.resizeTo(screen.availWidth,screen.availHeight);", true);

        RepPagamentosExtFinanciamentoCorrigido report = new RepPagamentosExtFinanciamentoCorrigido();

        // Use SqlDataAdapter to define and populate a DataSet using the information extracted from a Session vairable

        // EMPRESA MATRIZ
        report.ltempresa.Text = uEmpresa.PegaNome(uEmpresa.PegaMatriz());

        // PRODUTO
        string produto = Convert.ToString(Session["cbproduto"]);

        if (produto == "")
        {
            report.lfproduto.Text = "Todos";
        }
        else
        {
            if (produto.Substring(0, 1) == "'")
            {
                report.lfproduto.Text = "Alguns";
            }
            else
            {
                report.lfproduto.Text = produto + " - " + uProduto.PegaProdutoDescricao(Convert.ToInt32(produto));
            }
        }
        // GRUPO
        string grupo = Convert.ToString(Session["cbgrupo"]);

        if (grupo == "")
        {
            report.lfgrupo.Text = "Todos";
        }
        else
        {
            if (grupo.Substring(0, 1) == "'")
            {
                report.lfgrupo.Text = "Alguns";
            }
            else
            {
                report.lfgrupo.Text = grupo + " - " + uProduto.PegaProdutoGrupoDescricao(Convert.ToInt32(produto), Convert.ToInt32(grupo));
            }
        }
        // UNIDADE
        string unidade = Convert.ToString(Session["cbgrupounidades"]);

        if (unidade == "")
        {
            report.lfgrupounidade.Text = "Todas";
        }
        else
        {
            if (unidade.Substring(0, 1) == "'")
            {
                report.lfgrupounidade.Text = "Algumas";
            }
            else
            {
                report.lfgrupounidade.Text = unidade;
            }
        }
        // PARTE
        string parte = Convert.ToString(Session["cbparte"]);

        if (parte != "0")
        {
            report.lfgrupounidade.Text = report.lfgrupounidade.Text + " - Parte: " + parte;
        }
        // MEIOLOTE
        string meiolote = Convert.ToString(Session["cbmeiolote"]);

        if (parte != "0")
        {
            report.lfgrupounidade.Text = report.lfgrupounidade.Text + " - Meio Lote: " + meiolote + "o.";
        }
        // CONTA CORRENTE
        string contacorrente = Convert.ToString(Session["cbcontacorrente"]);

        if (contacorrente == "")
        {
            report.lfcontacorrente.Text = "Todas";
            contacorrente = "0";
        }
        else
        {
            if (contacorrente.Substring(0, 1) == "'")
            {
                report.lfcontacorrente.Text = "Alguns";
            }
            else
            {
                report.lfcontacorrente.Text = uContas.PegaContaDescricao(contacorrente);
            }
        }
        // PROPRIETARIO
        string cliente = Convert.ToString(Session["cbcliente"]);

        if (cliente == "")
        {
            report.lfproprietario.Text = "Todas";
        }
        else
        {
            if (cliente.Substring(0, 1) == "'")
            {
                report.lfproprietario.Text = "Alguns";
            }
            else
            {
                report.lfproprietario.Text = uContato.PegaNomeID(cliente) + "-" + Srelib.FormataCPFCNPJ(uContato.PegaCpfCnpjID(cliente));
            }
        }
        // PAGAMENTOS
        string rbpagamentos  = Convert.ToString(Session["rbpagamentos"]);
        string xrbpagamentos = "T";

        report.lfparcelas.Text = "Todas";
        if (rbpagamentos == "1")
        {
            report.lfparcelas.Text = "Pagas";
            xrbpagamentos          = "P";
        }
        if (rbpagamentos == "2")
        {
            report.lfparcelas.Text = "Em Aberto";
            xrbpagamentos          = "A";
        }
        if (rbpagamentos == "3")
        {
            report.lfparcelas.Text = "Atrasadas";
            xrbpagamentos          = "A2";
        }
        if (rbpagamentos == "4")
        {
            report.lfparcelas.Text = "Á Vencer";
            xrbpagamentos          = "A3";
        }
        // PERIODO FILTRO
        DateTime dtprevisao1 = Convert.ToDateTime(Session["dtprevisao1"]);
        DateTime dtprevisao2 = Convert.ToDateTime(Session["dtprevisao2"]);

        report.lfperiodo.Text = dtprevisao1.Date.ToString().Substring(0, 10) + " até " + dtprevisao2.Date.ToString().Substring(0, 10);
        if (unidade != string.Empty)
        {
            DateTime dtprevisaovenda1 = uVendas.PegaDataVenda(produto, grupo, unidade, parte);
            DateTime dtprevisaovenda2 = uParcelas.PegaUltimoVencimento(produto, grupo, unidade, parte, meiolote);
            // VENDA
            report.lfdatavenda.Text = dtprevisaovenda1.Date.ToString().Substring(0, 10);
            // PERIODO VENDA
            report.lfperiodovenda.Text = dtprevisaovenda1.Date.ToString().Substring(0, 10) + " até " + dtprevisaovenda2.Date.ToString().Substring(0, 10);
            //
            report.lfcorrecao.Text = "";
            report.lfcorrecao.Text = report.lfcorrecao.Text + uVendas.PegaPeriodicidade(produto, grupo, unidade, parte, meiolote);
            report.lfcorrecao.Text = report.lfcorrecao.Text + " - " + uVendas.PegaIndexador(produto, grupo, unidade, parte);
            report.lfcorrecao.Text = report.lfcorrecao.Text + " - BASE: ";
            report.lfcorrecao.Text = report.lfcorrecao.Text + uVendas.PegaDataBase(produto, grupo, unidade, parte).ToString().Substring(0, 10);
        }
        else
        {
            report.xrLabel31.Visible   = false;
            report.lfdatavenda.Visible = false;
            //
            report.xrLabel29.Visible      = false;
            report.lfperiodovenda.Visible = false;
            //
            report.xrLabel30.Visible  = false;
            report.lfcorrecao.Visible = false;
        }
        //DATA CORRECAO
        DateTime dtcorrecao = Convert.ToDateTime(Session["dtcorrecao"].ToString().Substring(0, 10));

        report.lfcorrecaoate.Text = dtcorrecao.ToString().Substring(0, 10);
        report.dtfimcorrecao      = dtcorrecao;
        //
        // USUÁRIO
        string usuario = Convert.ToString(Session["CodUsuario"]);

        report.ltusuario.Text = "Usuário: " + usuario;
        //
        // RODAPÉ
        report.lcaminho.Text = "Gitano ->SGFin ->Pagamentos ->Relatório Extrato de Financiamento Corrigido";
        // LEGENDA
        report.llegenda.Text = "Coluna Origem dos Pagamentos [B = Pagamento Carteira][C = Cobrança Bancária]";
        report.llegenda.Text = report.llegenda.Text + " - Coluna A/I [A = Ativa][I = Inativa]";
        report.llegenda.Text = report.llegenda.Text + " | Vencidos e á Vencer na emissão do relatório.";
        if (uVendas.TemRenegociacao(produto, grupo, unidade, parte))
        {
            report.llegenda.Text = report.llegenda.Text + " | Financiamento possui renegociação.";
        }
        else
        {
            report.llegenda.Text = report.llegenda.Text + " | Financiamento não possui renegociação.";
        }
        //
        DataSet ds;

        ds = uParcelas.PegaDadosParcelas2(produto,
                                          grupo,
                                          unidade,
                                          parte,
                                          meiolote,
                                          dtprevisao1.ToString().Substring(0, 10),
                                          dtprevisao2.ToString().Substring(0, 10),
                                          xrbpagamentos,
                                          contacorrente,
                                          "N",
                                          false,
                                          "0");

        //
        report.DataSource = ds;
        report.DataMember = ds.Tables[0].TableName;
        report.lid.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", null, "produto")
        });
        //report.lgrupo.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
        //    new DevExpress.XtraReports.UI.XRBinding("Text", null, "grupo")});
        report.lunidade.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", null, "unidade")
        });
        report.lparte.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", null, "parte")
        });
        report.lparcela.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", null, "parcela")
        });
        report.ltipo.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", null, "tipo")
        });
        report.lconta.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", null, "conta")
        });
        report.ldatavencimento.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", null, "data_vencimento", "{0:dd/MM/yyyy}")
        });
        report.lvlrparcela.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", null, "vlr_parcela", "{0:N}")
        });
        //report.ldatapagamento.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
        //    new DevExpress.XtraReports.UI.XRBinding("Text", null, "data_pagamento", "{0:dd/MM/yyyy}")});
        report.lvlrpagamento.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", null, "vlr_pagamento", "{0:N}")
        });
        //report.lvlrmulta.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
        //    new DevExpress.XtraReports.UI.XRBinding("Text", null, "vlr_multa", "{0:N}")});
        //report.lvlrdesconto.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
        //    new DevExpress.XtraReports.UI.XRBinding("Text", null, "vlr_desconto", "{0:N}")});
        report.lorigem.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", null, "origem_pagamento")
        });
        //report.lativo.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
        //    new DevExpress.XtraReports.UI.XRBinding("Text", null, "ativa", "{0:N}")});
        report.lobs.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", null, "observacao")
        });
        //

        if (ds.Tables[0].Rows.Count > 0)
        {
            ReportViewer1.Report = report;
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "msgbox", "alert('Nada a Imprimir!');", true);
            Page.ClientScript.RegisterStartupScript(GetType(), "close", "self.close()", true);
        }
    }
コード例 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if ((String)Session["IdSessao"] == null)
        {
            Session.Add("fimdesessao", "A Sessão foi expirada, reinicie o sistema!");
            Server.Transfer("~\\LoginTimeOut.aspx");
        }

        ScriptManager.RegisterStartupScript(this, typeof(string), "MAXIMIZE", "top.window.moveTo(0,0); top.window.resizeTo(screen.availWidth,screen.availHeight);", true);

        RepPagamentosInadimplentes report = new RepPagamentosInadimplentes();

        // Use SqlDataAdapter to define and populate a DataSet using the information extracted from a Session vairable

        // EMPRESA MATRIZ
        report.ltempresa.Text = uEmpresa.PegaNome(uEmpresa.PegaMatriz());

        // PRODUTO
        string produto = Convert.ToString(Session["cbproduto"]);

        if (produto == "")
        {
            report.lfproduto.Text = "Todos";
        }
        else
        {
            if (produto.Substring(0, 1) == "'")
            {
                report.lfproduto.Text = "Alguns";
            }
            else
            {
                report.lfproduto.Text = produto + " - " + uProduto.PegaProdutoDescricao(Convert.ToInt32(produto));
            }
        }
        // GRUPO
        string grupo = Convert.ToString(Session["cbgrupo"]);

        if (grupo == "")
        {
            report.lfgrupo.Text = "Todos";
        }
        else
        {
            if (grupo.Substring(0, 1) == "'")
            {
                report.lfgrupo.Text = "Alguns";
            }
            else
            {
                report.lfgrupo.Text = grupo + " - " + uProduto.PegaProdutoGrupoDescricao(Convert.ToInt32(produto), Convert.ToInt32(grupo));
            }
        }
        // UNIDADE
        string unidade = Convert.ToString(Session["cbgrupounidades"]);

        if (unidade == "")
        {
            report.lfgrupounidade.Text = "Todas";
        }
        else
        {
            if (unidade.Substring(0, 1) == "'")
            {
                report.lfgrupounidade.Text = "Algumas";
            }
            else
            {
                report.lfgrupounidade.Text = unidade;
            }
        }
        // PARTE
        string parte = Convert.ToString(Session["cbparte"]);

        if (parte != "0")
        {
            report.lfgrupounidade.Text = report.lfgrupounidade.Text + " - Parte: " + parte;
        }
        // MEIOLOTE
        string meiolote = Convert.ToString(Session["cbmeiolote"]);

        if (parte != "0")
        {
            report.lfgrupounidade.Text = report.lfgrupounidade.Text + " - Meio Lote: " + meiolote + "o.";
        }
        // CONTA CORRENTE
        string contacorrente = Convert.ToString(Session["cbcontacorrente"]);

        if (contacorrente == "")
        {
            report.lfcontacorrente.Text = "Todas";
            contacorrente = "0";
        }
        else
        {
            if (contacorrente.Substring(0, 1) == "'")
            {
                report.lfcontacorrente.Text = "Alguns";
            }
            else
            {
                report.lfcontacorrente.Text = uContas.PegaContaDescricao(contacorrente);
            }
        }
        // PROPRIETARIO
        string cliente = Convert.ToString(Session["cbcliente"]);

        if (cliente == "")
        {
            report.lfproprietario.Text = "Todas";
        }
        else
        {
            if (cliente.Substring(0, 1) == "'")
            {
                report.lfproprietario.Text = "Alguns";
            }
            else
            {
                report.lfproprietario.Text = cliente + " - " + uContato.PegaNomeID(cliente) + " - CNPJ/CPF " + Srelib.FormataCPFCNPJ(uContato.PegaCpfCnpjID(cliente));
            }
        }
        // PERIODO
        DateTime dtprevisao1 = Convert.ToDateTime(Session["dtprevisao1"]);
        DateTime dtprevisao2 = Convert.ToDateTime(Session["dtprevisao2"]);

        report.lfperiodo.Text = dtprevisao1.Date.ToString().Substring(0, 10) + " até " + dtprevisao2.Date.ToString().Substring(0, 10);
        //
        //Protesto
        string rbprotesto = Convert.ToString(Session["rbprotesto"]);

        if (rbprotesto == "0")
        {
            report.lfprotesto.Text = "Todas";
        }
        else
        {
            if (rbprotesto == "1")
            {
                report.lfprotesto.Text = "Protestados";
            }
            if (rbprotesto == "2")
            {
                report.lfprotesto.Text = "Não Protestados";
            }
        }
        //
        //Tipo Parcela
        string rbtipoparcela = Convert.ToString(Session["rbtipoparcela"]);

        if (rbtipoparcela == "0")
        {
            report.lftipoparcela.Text = "Todas";
        }
        else
        {
            if (rbtipoparcela == "1")
            {
                report.lftipoparcela.Text = "Sinal";
            }
            if (rbtipoparcela == "2")
            {
                report.lftipoparcela.Text = "Normal ou Renegociação";
            }
            if (rbtipoparcela == "3")
            {
                report.lftipoparcela.Text = "Intermediárias";
            }
        }
        //
        //Ordem
        string rbordem = Convert.ToString(Session["rbordem"]);

        if (rbordem == "0")
        {
            report.lfordem.Text = "Data de Vencimento";
        }
        else
        {
            if (rbordem == "1")
            {
                report.lfordem.Text = "Unidade";
            }
        }
        //
        //Desistentes
        string ckdesistentes = Convert.ToString(Session["ckdesistentes"]);

        if (ckdesistentes == "False")
        {
            report.lfdesistentes.Text = "Não";
        }
        else
        {
            report.lfdesistentes.Text = "Sim";
        }
        //
        //
        //Quebra pagina
        Boolean ckquebrapagina = Convert.ToBoolean(Session["ckquebrapagina"]);

        report.ckquebrapagina = ckquebrapagina;
        //
        //Numero de Parcelas
        string rbnumeroparcelas = Convert.ToString(Session["rbnumeroparcelas"]);

        if (rbnumeroparcelas == "0")
        {
            report.lfparcelas.Text = "Todas";
        }
        else
        {
            report.lfparcelas.Text = rbnumeroparcelas;
        }
        //
        //Numero de Parcelas em diante
        string cknumeroparcelas = Convert.ToString(Session["cknumeroparcelas"]);

        if (cknumeroparcelas == "True")
        {
            report.lfparcelas.Text = report.lfparcelas.Text + " em diante";
        }
        //
        // USUÁRIO
        string usuario = Convert.ToString(Session["CodUsuario"]);

        report.ltusuario.Text = "Usuário: " + usuario;
        //
        // RODAPÉ
        report.lcaminho.Text = "Gitano ->SGFin ->Pagamentos ->Relatório Inadimplentes";
        // LEGENDA
        report.llegenda.Text = "Coluna Origem dos Pagamentos [B = Pagamento Carteira][C = Cobrança Bancária]";
        report.llegenda.Text = report.llegenda.Text +
                               " - Coluna Vlr. Parcela Corrigida [Apresenta a correção até a data de emissão do Relatório]";
        //
        DataSet ds;

        if (rbnumeroparcelas == "0")
        {
            ds = uParcelas.PegaDadosParcelasDevedores(produto,
                                                      grupo,
                                                      unidade,
                                                      parte,
                                                      meiolote,
                                                      dtprevisao1.ToString().Substring(0, 10),
                                                      dtprevisao2.ToString().Substring(0, 10),
                                                      contacorrente,
                                                      rbprotesto,
                                                      rbtipoparcela,
                                                      rbordem,
                                                      ckdesistentes,
                                                      "0");
        }
        else
        {
            ds = uParcelas.PegaDadosParcelasInadimplentes(produto,
                                                          grupo,
                                                          unidade,
                                                          parte,
                                                          meiolote,
                                                          dtprevisao1.ToString().Substring(0, 10),
                                                          dtprevisao2.ToString().Substring(0, 10),
                                                          contacorrente,
                                                          rbprotesto,
                                                          rbtipoparcela,
                                                          rbordem,
                                                          ckdesistentes,
                                                          rbnumeroparcelas,
                                                          cknumeroparcelas);
        }
        //
        report.DataSource = ds;
        report.DataMember = ds.Tables[0].TableName;
        report.lid.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", null, "produto")
        });
        //report.lgrupo.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
        //    new DevExpress.XtraReports.UI.XRBinding("Text", null, "grupo")});
        report.lunidade.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", null, "unidade")
        });
        report.lparte.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", null, "parte")
        });
        report.lparcela.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", null, "parcela")
        });
        report.ltipo.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", null, "tipo")
        });
        report.lconta.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", null, "conta")
        });
        report.ldatavencimento.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", null, "data_vencimento", "{0:dd/MM/yyyy}")
        });
        report.lvlrparcela.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", null, "vlr_parcela", "{0:N}")
        });
        //report.ldatapagamento.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
        //    new DevExpress.XtraReports.UI.XRBinding("Text", null, "data_pagamento", "{0:dd/MM/yyyy}")});
        //report.lvlrpagamento.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
        //    new DevExpress.XtraReports.UI.XRBinding("Text", null, "vlr_pagamento", "{0:N}")});
        //report.lprotesto.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
        //    new DevExpress.XtraReports.UI.XRBinding("Text", null, "protesto")});
        //report.lativa.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
        //    new DevExpress.XtraReports.UI.XRBinding("Text", null, "ativa")});
        report.lorigem.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", null, "origem_pagamento")
        });
        report.lnossonumero.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", null, "nossonumero")
        });
        //
        report.eimprimedatavencimento = false;
        report.eimprimeunidade        = false;
        if (rbordem == "0")
        {
            // Carrega quebra por DATA DE PAGAMENTOS
            report.headerdata.GroupFields.Clear();                                              // DESABILITA O CAMPO DE QUEBRA DO GROUPHEADER  =====================================================================================
            report.headerdata.GroupFields.AddRange(new DevExpress.XtraReports.UI.GroupField[] { // CRIA CAMPO DE QUEBRA ==========================================================================================
                new DevExpress.XtraReports.UI.GroupField("data_vencimento", DevExpress.XtraReports.UI.XRColumnSortOrder.Ascending),
            });                                                                                 // NO GROUPHEADER       ==========================================================================================
            report.eimprimedatavencimento = true;
        }
        else
        {
            if (rbordem == "1")
            {
                // Carrega quebra por UNIDADE
                report.headerunidade.GroupFields.Clear();                                              // DESABILITA O CAMPO DE QUEBRA DO GROUPHEADER  =====================================================================================
                report.headerunidade.GroupFields.AddRange(new DevExpress.XtraReports.UI.GroupField[] { // CRIA CAMPO DE QUEBRA ==========================================================================================
                    new DevExpress.XtraReports.UI.GroupField("identificador", DevExpress.XtraReports.UI.XRColumnSortOrder.Ascending),
                });                                                                                    // NO GROUPHEADER       ==========================================================================================
                report.eimprimeunidade = true;
            }
        }
        //
        if (ds.Tables[0].Rows.Count > 0)
        {
            ReportViewer1.Report = report;
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "msgbox", "alert('Nada a Imprimir!');", true);
            Page.ClientScript.RegisterStartupScript(GetType(), "close", "self.close()", true);
        }
    }
コード例 #4
0
ファイル: RepParcelas.cs プロジェクト: Airam1968/VS2017-SFin
    private void Detail_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
    {
        //
        string parcela = Convert.ToString(GetCurrentColumnValue("parcela"));
        string tipo    = Convert.ToString(GetCurrentColumnValue("tipo"));

        lnumero.Text = parcela + " Tipo: (" + tipo + ")";
        //
        string vencimento = Convert.ToString(GetCurrentColumnValue("data_vencimento")).Substring(0, 10);

        lvencimento.Text = vencimento;
        //
        string pagamento = Convert.ToString(GetCurrentColumnValue("data_pagamento")).Substring(0, 10);

        lpagamento.Text = pagamento;
        //
        string vlr_parcela = Convert.ToString(GetCurrentColumnValue("vlr_parcela"));

        lvalorparcela.Text = Srelib.forcaponto(vlr_parcela);
        //
        //
        string vlr_pagamento = Convert.ToString(GetCurrentColumnValue("vlr_pagamento"));

        lvalorpagamento.Text = Srelib.forcaponto(vlr_pagamento);
        //
        double diferenca = Convert.ToDouble(GetCurrentColumnValue("vlr_pagamento")) -
                           Convert.ToDouble(GetCurrentColumnValue("vlr_parcela"));

        //
        lvaloracrescimos.Text = "0,00";
        lvalordesconto.Text   = "0,00";
        if (diferenca != 0)
        {
            if (diferenca > 0)
            {
                lvaloracrescimos.Text = Srelib.forcaponto(Convert.ToString(diferenca));
            }
            else
            {
                lvalordesconto.Text = Srelib.forcaponto(Convert.ToString(diferenca * -1));
            }
        }
        //
        Int32 produto = Convert.ToInt32(GetCurrentColumnValue("produto"));

        lvinculo2.Text = uProduto.PegaProdutoDescricao(produto);
        //
        Int32 grupo   = Convert.ToInt32(GetCurrentColumnValue("grupo"));
        Int32 unidade = Convert.ToInt32(GetCurrentColumnValue("unidade"));
        Int32 parte   = Convert.ToInt32(GetCurrentColumnValue("parte"));
        Int32 id      = Convert.ToInt32(GetCurrentColumnValue("ID"));

        //
        lvinculo3.Text = "Bloco No. " + grupo.ToString() + " Unidade No. " + unidade.ToString();
        lvinculo3.Text = " " + lvinculo3.Text + " Parte No. " + parte.ToString();
        //
        //lvencimentoextenso.Text = Srelib.DataExtenso(Convert.ToDateTime(vencimento));
        //
        lnomeempresa.Text = uEmpresa.PegaNome(uEmpresa.PegaMatriz());
        //
        lcnpjempresa.Text = Srelib.FormataCPFCNPJ(uEmpresa.PegaCnpj(uEmpresa.PegaMatriz()));
        //
        ValorExtenso xExt = new ValorExtenso();
        String       xAux;

        xAux = xExt.ValExtenso(Convert.ToDouble(vlr_pagamento));
        lvalorextenso1.Text = xAux;
        lvalorextenso2.Text = " ";
        //
        lcidadeestadoextenso.Text = uEmpresa.PegaCidade(uEmpresa.PegaMatriz()) + ", " + uEmpresa.PegaEstado(uEmpresa.PegaMatriz()) + ".";
        //
        lemissaoextenso.Text = uEmpresa.PegaCidade(uEmpresa.PegaMatriz()) + ", " + Srelib.DataExtenso(DateTime.Now);
        //
        //
        string cliente = uVendas.PegaProprietário(produto.ToString(), grupo.ToString(), unidade.ToString(), "0");

        lemitentenome.Text = uContato.PegaNomeID(cliente);
        lemitentecpf.Text  = Srelib.FormataCPFCNPJ(uContato.PegaCpfCnpjID(cliente));
        //
        //
        ////TITULO RECIBO
        //uParcelas.GravaRecibo(produto.ToString(), grupo.ToString(), unidade.ToString(), parte.ToString(), id.ToString(), recibo.ToString());
        //uParametros.AlteraMigracao("PROXIMO RECIBO", Convert.ToString(Convert.ToInt64(recibo) + 1));
    }
コード例 #5
0
    public void PegaDadosDoCedente(String wcedente)
    {
        String sql = @"Select cnpj,
                              apelido, nome,
                              endereco,
                              bairro, cidade, uf, cep,
                              fone, contato, gerente, ramo, grupo,
                              isnull(l_acum,0.00) l_acum, 
                              isnull(l_acumch,0.00) l_acumch,
                              isnull(l_acumdp,0.00) l_acumdp,
                              isnull(l_sac,0.00) l_sac, 
                              isnull(l_sacch,0.00) l_sacch,
                              isnull(l_sacdp,0.00) l_sacdp,
                              dlimite,
                              isnull(l_valor,0.00) l_valor, 
                              isnull(l_titulos,0.00) l_titulos, 
                              vencimento,
                              isnull(l_nconf,0.00) l_nconf, 
                              isnull(limitech,0.00) limitech, 
                              isnull(pconfir,0.00) pconfir, 
                              isnull(cnpjmin,0.00) cnpjmin, 
                              isnull(prazomin,0) prazomin, 
                              isnull(prazomax,0) prazomax,
                              isnull(tdesc,0.00) tdesc, 
                              isnull(txserv,0.00) txserv 
                       from cedente where apelido=@cedente";

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

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

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

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