コード例 #1
0
        private void _winWinScrapeThenSaveStore(bool isNew = false, bool needScrape = true)
        {
            _log($"Start WinWinScrapeThenSaveStore (isNew={isNew})");

            var state = new ScraperWinWinStateModel()
            {
                IsNew = isNew,
            };

            var scraper = new ScraperWinWin(state);

            if (needScrape)
            {
                scraper.Scrape();
            }

            var dataOfScrape = scraper.GetDomainModel();

            var excelService = new ExcelWinWinService(state);

            var excelData = excelService.CreateExcel(dataOfScrape);

            var pathToFile = excelService.SaveToFile(excelData);

            var archive = new ArchiveRepository();

            archive.Save(pathToFile, state.TypeScraper);

            _log($"End WinWinScrapeThenSaveStore (isNew={isNew}), Spent time {_calcSpentTime2String(state)}");
        }
コード例 #2
0
        public void Update()
        {
            var scraper = new ScraperWinWin(new ScraperWinWinStateModel());

            var repository = scraper.GetRepository();
            var model      = scraper.GetDomainModel();
            var isOk       = repository.UpdateData(model);
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: Ori021586060/Scrapers
        static void GetExcelFile(ScraperWinWin scraper)
        {
            var model = scraper.GetDomainModel();

            var excelService = scraper.GetExcelService();

            var excelData = excelService.CreateExcel(model);

            var filename = excelService.SaveToFile(excelData);
        }