示例#1
0
        public TransportePessoaExpostaPoliticamente(PessoaExpostaPoliticamenteInfo pPessoa)
        {
            this.Id = pPessoa.IdPEP.Value;

            this.Nome           = pPessoa.DsNome.ToStringFormatoNome();
            this.Documento      = pPessoa.DsDocumento.ToCpfCnpjString();
            this.DataImportacao = pPessoa.DtImportacao.ToString("dd/MM/yyyy");
        }
        /*
         * private static SalvarEntidadeResponse<PessoaExpostaPoliticamenteInfo> Atualizar (SalvarObjetoRequest<PessoaExpostaPoliticamenteInfo> pParametros)
         * {
         *  ConexaoDbHelper lAcessaDados = new ConexaoDbHelper();
         *
         *  lAcessaDados.ConnectionStringName = gNomeConexao;
         *
         *  using (DbCommand lDbCommand = lAcessaDados.CreateCommand(CommandType.StoredProcedure, "paises_blacklist_upd_sp"))
         *  {
         *      lAcessaDados.AddInParameter(lDbCommand, "@cd_pais", DbType.String, pParametros.Objeto.CdPais);
         *      lAcessaDados.AddInParameter(lDbCommand, "@id_pais_blacklist", DbType.Int32, pParametros.Objeto.IdPaisBlackList);
         *
         *      lAcessaDados.ExecuteNonQuery(lDbCommand);
         *
         *      return new SalvarEntidadeResponse<PessoaExpostaPoliticamenteInfo>();
         *  }
         * }*/


        private static void LogarModificacao(PessoaExpostaPoliticamenteInfo pParametro, int IdUsuarioLogado, string DescricaoUsuarioLogado)
        {
            ReceberEntidadeRequest <PessoaExpostaPoliticamenteInfo> lEntrada = new ReceberEntidadeRequest <PessoaExpostaPoliticamenteInfo>();

            lEntrada.Objeto = pParametro;
            ReceberObjetoResponse <PessoaExpostaPoliticamenteInfo> lRetorno = ReceberPessoaExpostaPoliticamente(lEntrada);

            LogCadastro.Logar(lRetorno.Objeto, IdUsuarioLogado, DescricaoUsuarioLogado, LogCadastro.eAcao.Receber);
        }
示例#3
0
        private void BuscarItens()
        {
            //string lRetorno = "Erro...";

            ConsultarEntidadeCadastroRequest <PessoaExpostaPoliticamenteInfo>  lRequest  = new ConsultarEntidadeCadastroRequest <PessoaExpostaPoliticamenteInfo>();
            ConsultarEntidadeCadastroResponse <PessoaExpostaPoliticamenteInfo> lResponse = new ConsultarEntidadeCadastroResponse <PessoaExpostaPoliticamenteInfo>();

            PessoaExpostaPoliticamenteInfo lDadosDeBusca = new PessoaExpostaPoliticamenteInfo();

            lRequest.EntidadeCadastro = lDadosDeBusca;

            lRequest.IdUsuarioLogado = base.UsuarioLogado.Id;

            lRequest.DescricaoUsuarioLogado = base.UsuarioLogado.Nome;

            lRequest.EntidadeCadastro = new PessoaExpostaPoliticamenteInfo();

            if (DsDocumento != null && DsDocumento != string.Empty)
            {
                lRequest.EntidadeCadastro.DsDocumento = this.DsDocumento;
            }

            if (DsNome != null && DsNome != string.Empty)
            {
                lRequest.EntidadeCadastro.DsNome = this.DsNome;
            }

            this.SessionUltimoResultadoDeBusca = null;

            try
            {
                lResponse = this.ServicoPersistenciaCadastro.ConsultarEntidadeCadastro <PessoaExpostaPoliticamenteInfo>(lRequest);

                if (lResponse.StatusResposta == MensagemResponseStatusEnum.OK)
                {
                    this.SessionUltimoResultadoDeBusca = lResponse.Resultado;
                }
            }
            catch
            {
                //RetornarErroAjax("Erro durante a busca", exBusca);
            }

            //return lRetorno;
        }
示例#4
0
        private void ResponderImportarPEP_Async(object pIdDaImportacaoEConteudo)
        {
            string lIdDaImportacao    = ((string[])pIdDaImportacaoEConteudo)[0];
            string lConteudoDoArquivo = ((string[])pIdDaImportacaoEConteudo)[1];

            TransporteImportacaoPEP lTransporte = this.ApplicationImportacoesPEPSendoEfetuadas[lIdDaImportacao];

            List <PessoaExpostaPoliticamenteInfo> lListaParaImportar = new List <PessoaExpostaPoliticamenteInfo>();

            if (lTransporte != null)
            {
                SalvarEntidadeRequest <PessoaExpostaPoliticamenteImportacaoInfo> lRequest = new SalvarEntidadeRequest <PessoaExpostaPoliticamenteImportacaoInfo>();
                SalvarObjetoResponse <PessoaExpostaPoliticamenteImportacaoInfo>  lResponse;

                string[] lLinhas = lConteudoDoArquivo.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);

                Dictionary <string, string> lJaImportados = new Dictionary <string, string>();

                PessoaExpostaPoliticamenteInfo lNovaPessoa;

                foreach (PessoaExpostaPoliticamenteInfo lPessoaImportada in this.SessionUltimoResultadoDeBusca)
                {
                    if (!lJaImportados.ContainsKey(lPessoaImportada.DsDocumento))
                    {
                        lJaImportados.Add(lPessoaImportada.DsDocumento, lPessoaImportada.DsNome);
                    }
                }

                foreach (string lLinha in lLinhas)
                {
                    if (!string.IsNullOrEmpty(lLinha) && lLinha.StartsWith("110"))
                    {
                        lNovaPessoa = new PessoaExpostaPoliticamenteInfo(lLinha);

                        if (!lJaImportados.ContainsKey(lNovaPessoa.DsDocumento))     //TODO: método melhor pra não-repetidos? direto na tabela?
                        {
                            lListaParaImportar.Add(lNovaPessoa);
                        }
                    }
                }

                lRequest.Objeto = new PessoaExpostaPoliticamenteImportacaoInfo()
                {
                    ListaParaImportar = lListaParaImportar
                };

                lRequest.IdUsuarioLogado = base.UsuarioLogado.Id;

                lRequest.DescricaoUsuarioLogado = base.UsuarioLogado.Nome;

                lResponse = ((ServicoPersistenciaCadastro)this.ServicoPersistenciaCadastro).ImportarPessoasExpostasPoliticamente(lRequest);

                lTransporte.MensagemDeFinalizacao = "Registros importados com sucesso";

                lTransporte.RegistrosImportadosComSucesso = lResponse.Objeto.RegistrosImportadosComSucesso;
                lTransporte.RegistrosComErro = lResponse.Objeto.RegistrosImportadosComErro;

                lTransporte.StatusDaImportacao = "Finalizada";

                this.SessionUltimoResultadoDeBusca = null;
            }
        }