private void ResponderArquivoCSV() { var lConteudoArquivo = new StringBuilder(); var lListaAssessores = base.ConsultarCodigoAssessoresVinculadosString(this.GetCdAssessor); var lResponse = base.ServicoPersistenciaCadastro.ConsultarEntidadeCadastro <TotalClientePorAssessorInfo>(new ConsultarEntidadeCadastroRequest <TotalClientePorAssessorInfo>() { EntidadeCadastro = new TotalClientePorAssessorInfo() { ConsultaCdAssessor = lListaAssessores, ConsultaDtNegocioInicio = this.GetDataNegocioInicio, ConsultaDtNegocioFim = this.GetDataNegocioFim } }); if (lResponse.StatusResposta == MensagemResponseStatusEnum.OK) { var lTransporte = new TransporteRelatorio_005().TraduzirLista(lResponse.Resultado); lConteudoArquivo.AppendLine("Total de cliente por assessor\t\r\n\r\n"); lConteudoArquivo.AppendFormat("{0}Clientes operaram no dia: {1}\n\r\n", lTransporte.Count.ToString(), this.GetDataNegocioInicio.ToString("dd/MM/yyyy")); if (lTransporte.Count > 0) { lConteudoArquivo.AppendFormat("Assessor: {0}\tBolsa\tC.B.\tDV\t\tC.L.\tF.G\tP.C.\tV.C.\r\n", base.UsuarioLogado.Nome); lTransporte.ForEach(toc => { lConteudoArquivo.AppendFormat("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}\r\n", toc.Cliente, toc.Bolsa, toc.CB, toc.DVDesconto, toc.DVPercentual, toc.CL, toc.FG, toc.PC, toc.VC); }); lConteudoArquivo.AppendFormat("Totais:\t\t{0}\t{1}\t-\t{2}\t{3}\t{4}\t{5}", lTransporte[0].TotalCB, lTransporte[0].TotalDV, lTransporte[0].TotalCL, lTransporte[0].TotalFG, lTransporte[0].TotalPC, lTransporte[0].TotalVC); } 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=TotalAssessorPorCliente.xls"); this.Response.Write(lConteudoArquivo.ToString()); this.Response.End(); } }
private string ResponderBuscarItensParaListagemSimples() { var lConsultaSaldo = base.ServicoPersistenciaCadastro.ConsultarEntidadeCadastro <RiscoClienteLimiteRelInfo>( new ConsultarEntidadeCadastroRequest <RiscoClienteLimiteRelInfo>( new RiscoClienteLimiteRelInfo() { ConsultaClienteParametro = this.GetParametroBusca, ConsultaClienteTipo = (OpcoesBuscarPor)this.GetTipoBusca, ConsultaFim = this.GetDataFim, ConsultaHistorico = this.GetHistorico, ConsultaIdParametro = this.GetParametro, ConsultaInicio = this.GetDataInicio, }) { DescricaoUsuarioLogado = base.UsuarioLogado.Nome, IdUsuarioLogado = base.UsuarioLogado.Id }); gConsultaMovimento = base.ServicoPersistenciaCadastro.ConsultarEntidadeCadastro <RiscoClienteLimiteMovimentoRelInfo>( new ConsultarEntidadeCadastroRequest <RiscoClienteLimiteMovimentoRelInfo>( new RiscoClienteLimiteMovimentoRelInfo() { ConsultaClienteParametro = this.GetParametroBusca, ConsultaClienteTipo = (OpcoesBuscarPor)this.GetTipoBusca, }) { DescricaoUsuarioLogado = base.UsuarioLogado.Nome, IdUsuarioLogado = base.UsuarioLogado.Id }); if (null != lConsultaSaldo.Resultado && !0.Equals(lConsultaSaldo.Resultado.Count)) { var listaTransporte = new TransporteRelatorio_005().TraduzirListaSaldo(lConsultaSaldo.Resultado); base.PopularComboComListaGenerica <TransporteRelatorio_005>(listaTransporte, this.rptRelatorio); this.rowLinhaDeNenhumItem.Visible = false; } else { this.rowLinhaDeNenhumItem.Visible = true; } return(string.Empty); }
private void ResponderBuscarItensParaListagemSimples() { var lListaAssessores = base.ConsultarCodigoAssessoresVinculadosString(this.GetCdAssessor); var lResponse = base.ServicoPersistenciaCadastro.ConsultarEntidadeCadastro <TotalClientePorAssessorInfo>(new ConsultarEntidadeCadastroRequest <TotalClientePorAssessorInfo>() { EntidadeCadastro = new TotalClientePorAssessorInfo() { ConsultaCdAssessor = lListaAssessores, ConsultaDtNegocioInicio = this.GetDataNegocioInicio, ConsultaDtNegocioFim = this.GetDataNegocioFim, } }); if (lResponse.StatusResposta == MensagemResponseStatusEnum.OK) { var lTransporte = new TransporteRelatorio_005().TraduzirLista(lResponse.Resultado); if (lTransporte.Count > 0) { this.gDescricaoOperador = lTransporte[0].Operador; this.gTotalClientesOperaram = lTransporte.Count.ToString(); this.gDataConsultaInicio = this.GetDataNegocioInicio.ToString("dd/MM/yyyy"); this.gDataConsultaFim = this.GetDataNegocioFim.ToString("dd/MM/yyyy"); this.gTotalCB = lTransporte[0].TotalCB; this.gTotalDV = lTransporte[0].TotalDV; this.gTotalCL = lTransporte[0].TotalCL; this.gTotalFG = lTransporte[0].TotalFG; this.gTotalPC = lTransporte[0].TotalPC; this.gTotalVC = lTransporte[0].TotalVC; } this.rptTotalDeAssessorPorCliente.DataSource = lTransporte; this.rptTotalDeAssessorPorCliente.DataBind(); } }