private void CarregarDadosReceita() { if (this.GetDadosReceita.StatusResposta == MensagemResponseStatusEnum.OK) { var lTransporte = new TransporteRelatorio_002_Receita(this.GetDadosReceita.EntidadeCadastro, this.GetCodigoAssessor); this.gReceitaBovespaClientes = lTransporte.BovespaClientes; this.gReceitaBovespaValor = lTransporte.BovespaValor; this.gReceitaBMFClientes = lTransporte.BMFClientes; this.gReceitaBMFValor = lTransporte.BMFValor; this.gReceitaBTCClientes = lTransporte.TBCClientes; this.gReceitaBTCValor = lTransporte.TBCValor; this.gReceitaTesouroClientes = lTransporte.TesouroClientes; this.gReceitaTesouroValor = lTransporte.TesouroValor; this.gReceitaOutrasClientes = lTransporte.OutrasClientes; this.gReceitaOutrasValor = lTransporte.OutrasValor; this.gReceitaTotalClientes = lTransporte.TotalClientes; this.gReceitaTotalValor = lTransporte.TotalValor; } }
private void ResponderArquivoCSV() { var lConteudoArquivo = new StringBuilder("Cadastro\n"); lConteudoArquivo.Append("\tQtde. Total\t% Total\tQtde. Ativos\t% Ativos\tQtde. Inativos\t% Inativos"); lConteudoArquivo.Append("\tQtde. Novos Cliente Mês\tQtde. Varejo\tQtde. Institucional\t% Operou no Mês\t% com Custódia\t\n"); if (this.GetDadosCadastrais.StatusResposta == MensagemResponseStatusEnum.OK) { var lTransporte = new TransporteRelatorio_002_Cadastro(this.GetDadosCadastrais.EntidadeCadastro); lConteudoArquivo.AppendFormat("\t{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t" , lTransporte.QuantidadeTotal, lTransporte.PercentualTotal, lTransporte.QuantidadeAtivos, lTransporte.PercentualAtivos, lTransporte.QuantidadeInativos, lTransporte.PercentualInativos); lConteudoArquivo.AppendFormat("{0}\t{1}\t{2}\t{3}\t{4}" , lTransporte.QuantidadeClientesNovos, lTransporte.QuantidadeVarejo, lTransporte.QuantidadeInstitucional, lTransporte.PercentualOperouNoMes, lTransporte.PercentualComCustodia); } lConteudoArquivo.Append("\nReceita / Canal / Métricas\n"); if (this.GetDadosReceita.StatusResposta == MensagemResponseStatusEnum.OK) { var lTransporte = new TransporteRelatorio_002_Receita(this.GetDadosReceita.EntidadeCadastro, this.GetCodigoAssessor); lConteudoArquivo.Append("\tCorr. BVSP\t% BVSP\tCorr. BM&F\t% BM&F\tCorr. BTC\t% BTC\tCorr. Tesouro\t% Tesouro\tCorr. outras\t% Outras\t\n"); lConteudoArquivo.AppendFormat("\t{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}\t{9}" , lTransporte.BovespaValor, lTransporte.BovespaClientes, lTransporte.BMFValor, lTransporte.BMFClientes, lTransporte.TBCValor, lTransporte.TBCClientes, lTransporte.TesouroValor, lTransporte.TesouroClientes, lTransporte.OutrasValor, lTransporte.OutrasClientes); } if (this.GetDadosCanal.StatusResposta == MensagemResponseStatusEnum.OK) { var lTransporte = new TransporteRelatorio_002_Canal(this.GetDadosCanal.EntidadeCadastro, this.GetCodigoAssessor); lConteudoArquivo.Append("\r\tCorr. HB\t% HB\tCorr. Repassador\t% Repassador\tCorr. Mesa\t% Mesa\t"); lConteudoArquivo.AppendFormat("\r\t{0}\t{1}\t{2}\t{3}\t{4}\t{5}" , lTransporte.HbValor, lTransporte.HbPercentual, lTransporte.RepassadorValor, lTransporte.RepassadorPercentual, lTransporte.MesaValor, lTransporte.MesaPercentual); } if (this.GetDadosMetricas.StatusResposta == MensagemResponseStatusEnum.OK) { var lTransporte = new TransporteRelatorios_002_Metricas(this.GetDadosMetricas.EntidadeCadastro); lConteudoArquivo.Append("\r\tCorr. no Mês\t Cad. no Mês\tCorr. no Mês Anterior\t Cadastros no Mês Anterior\tCorr. Média no Período\t Cadastros Média no Período\t"); lConteudoArquivo.AppendFormat("\r\t{0}\t{1}\t{2}\t{3}\t{4}\t{5}" , lTransporte.CorretagemNoMes, lTransporte.CadastrosNoMes, lTransporte.CorretagemNoMesAnterior, lTransporte.CadastrosNoMesAnterior, lTransporte.CorretagemNoAno, lTransporte.CadastrosNoAno); } lConteudoArquivo.Append("\nTop 10 Clientes\n"); if (null != this.GetDadosTop10Clientes && (null != this.GetDadosTop10Clientes.Resultado) && (this.GetDadosTop10Clientes.StatusResposta == MensagemResponseStatusEnum.OK)) { var lTransporte = new TransporteRelatorios_002_Top10().TraduzirLista(this.GetDadosTop10Clientes.Resultado); lConteudoArquivo.Append("\tCliente\tR$\t% total\tDev. média %\tCustódia (R$)\r"); lTransporte.ForEach(top => { lConteudoArquivo.AppendFormat("\t{0}\t{1}\t{2}\t{3}\t{4}\t\r\n" , top.NomeCliente, top.Corretagem, top.PercentualTotal, top.PercentualDevMedia, top.Custodia); }); } this.Response.Clear(); this.Response.ContentType = "text/xls"; this.Response.ContentEncoding = Encoding.GetEncoding("iso-8859-1"); this.Response.Charset = "iso-8859-1"; this.Response.AddHeader("content-disposition", "attachment;filename=ResumoGerencial.xls"); this.Response.Write(lConteudoArquivo.ToString()); this.Response.End(); }