public ActionResult Finam(DownloadHistoryModel model)
 {
     IHistoricalProvider provider = new ClassLib.HistoricalProviders.Finam();
     model.Provider = provider;
     Download(model);
     return View("Download", model);
 }
        public ViewResult Download(string providerName)
        {
            ViewBag.TickerList = ModelHelper.GetTickerList(tickerRepository);
            ViewBag.TimeFrameList = ModelHelper.GetTimeFrameList(timeFrameRepository);

            DownloadHistoryModel model = new DownloadHistoryModel();
            model.DateFrom = DateTime.Now.Date.AddDays(-1);
            model.DateTo = DateTime.Now.Date;
            model.ProviderName = providerName;

            return View(model);
        }
        private void Download(DownloadHistoryModel model)
        {
            if (ModelState.IsValid)
            {
                int countDownload = model.DownloadAndSave();

                TempData["message"] = String.Format("Успешно загружено: {0} свечей", countDownload);
            }

            ViewBag.TickerList = ModelHelper.GetTickerList(tickerRepository);
            ViewBag.TimeFrameList = ModelHelper.GetTimeFrameList(timeFrameRepository);

        }