public LegalPersonModel StartSearch()
        {
            // Classe de Crawler base, apenas duplique
            // AddModule(new ExampleCrawler("julio+cesar"));

            var arispOut    = new object();
            var arispResult = new ArispCrawler(_find.Type, _find.CNPJ).Execute(out arispOut);

            AddModule(arispResult);
            _find.Arisp = (ArispModel)arispOut;

            var cagedOut    = new object();
            var cagedResult =
                new CagedCrawler("fiap", "senha", _find.Type, _find.CNPJ).Execute(out cagedOut);

            AddModule(cagedResult);
            _find.Caged = (CagedPJModel)cagedOut;

            var censecOut    = new object();
            var censecResult = new CensecCrawler("fiap", "fiap123", _find.CNPJ).Execute(out censecOut);

            AddModule(censecResult);
            _find.Censec = (CensecModel)censecOut;

            var detranOut    = new object();
            var detranResult = new DetranCrawler("12345678", "fiap123", _find.Type, _find.CNPJ).Execute(out detranOut);

            AddModule(detranResult);
            _find.Detran = (DetranModel)detranOut;

            var escavadorOut    = new object();
            var escavadorResult = new EscavadorCrawler("nome", _find.Type).Execute(out escavadorOut);

            AddModule(escavadorResult);

            var jucespOut    = new object();
            var jucespResult =
                new JucespCrawler(_find.Type).Execute(
                    out jucespOut);

            AddModule(jucespResult);
            _find.Jucesp = (JucespModel)jucespOut;


            var cadespOut    = new object();
            var cadespResult = new CadespCrawler(_find.CNPJ).Execute(out cadespOut);

            AddModule(cadespResult);

            _find.ResultadoFinal = new CrawlerResult
            {
                FindTotal   = _portais.Count,
                TotalErrors = _portais.Where(portal => portal == CrawlerStatus.Error).ToList().Count
            };
            return(_find);
        }
Пример #2
0
        public PhysicalPersonModel StartSearch()
        {
            // Classe de Crawler base, apenas duplique
            //AddModule(new ExampleCrawler("julio+cesar"));

            var arispOut    = new object();
            var arispResult = new ArispCrawler(_find.Type, _find.CPF).Execute(out arispOut);

            AddModule(arispResult);
            _find.Arisp = (ArispModel)arispOut;

            var arpenspOut    = new object();
            var arpenspResult = new ArpenspCrawler("123456").Execute(out arpenspOut);

            AddModule(arpenspResult);
            _find.Arpensp = (ArpenspModel)arpenspOut;

            var cagedOut    = new object();
            var cagedResult =
                new CagedCrawler("fiap", "fiap123", _find.Type, _find.CPF).Execute(out cagedOut);

            AddModule(cagedResult);
            _find.Caged = (CagedPFModel)cagedOut;

            var censecOut    = new object();
            var censecResult = new CensecCrawler("fiap", "fiap123", _find.CPF).Execute(out censecOut);

            AddModule(censecResult);
            _find.Censec = (CensecModel)censecOut;

            var sivecOut    = new object();
            var sivecResult =
                new SivecCrawler("fiap", "fiap123", "123456", _find.GetNomeCompleto(), _find.RG).Execute(
                    out sivecOut);

            AddModule(sivecResult);
            _find.Sivec = (SivecModel)sivecOut;

            var detranOut    = new object();
            var detranResult = new DetranCrawler("12345678", "fiap123", "123456", _find.Type, _find.CPF).Execute(out detranOut);

            AddModule(detranResult);
            _find.Detran = (DetranModel)detranOut;


            var infocrimOut    = new object();
            var infocrimResult = new InfocrimCrawler("12345678", "fiap123").Execute(out infocrimOut);

            AddModule(infocrimResult);
            _find.Infocrim = (InfocrimModel)infocrimOut;

            var sielOut    = new object();
            var sielResult = new SielCrawler(
                "fiap",
                "fiap123",
                "123456",
                _find.GetNomeCompleto(),
                _find.GetNomeDaMae(),
                _find.GetDataDeNascimento()
                ).Execute(out sielOut);

            AddModule(sielResult);
            _find.Siel = (SielModel)sielOut;

            var escavadorOut    = new object();
            var escavadorResult = new EscavadorCrawler("nome", _find.Type).Execute(out escavadorOut);

            AddModule(escavadorResult);

            _find.ResultadoFinal = new CrawlerResult
            {
                FindTotal   = _portais.Count,
                TotalErrors = _portais.Where(portal => portal == CrawlerStatus.Error).ToList().Count
            };
            return(_find);
        }