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)}"); }
public void Update() { var scraper = new ScraperWinWin(new ScraperWinWinStateModel()); var repository = scraper.GetRepository(); var model = scraper.GetDomainModel(); var isOk = repository.UpdateData(model); }
static void GetExcelFile(ScraperWinWin scraper) { var model = scraper.GetDomainModel(); var excelService = scraper.GetExcelService(); var excelData = excelService.CreateExcel(model); var filename = excelService.SaveToFile(excelData); }