public async override Task DoWork(CancellationToken cancellationToken, StatisticsBusiness statisticsBusiness) { _logger.LogInformation($"{DateTime.Now:hh:mm:ss} Statistic Job Working."); await statisticsBusiness.UpdateAsync(cancellationToken); await Task.CompletedTask; }
public ActionResult Index() { var model = new StatisticsViewModel(); model.Categories = EconomyBusiness.GetAllCategories(); model.SubCategories = EconomyBusiness.GetAllSubCategories(); model.Descriptions = EconomyBusiness.GetAllDescriptions(); model.Years = StatisticsBusiness.GetYears(); int selectedYear = -AppSettings.GetAppSettingsInteger("YearsBack");//DateTime.Now.AddYears(-AppSettings.GetAppSettingsInteger("YearsBack")).Year; model.SelectedYear = DateTime.Now.AddYears(selectedYear).Year; model.ChartSrc = StatisticsBusiness.GetChart(new FilterJson { CategoryId = 0, SubCategoryId = 0, Description = string.Empty, FromYear = model.SelectedYear }); return(View(model)); }
public JsonResult GetChart(FilterJson filterJson) { var chartImageSrc = StatisticsBusiness.GetChart(filterJson); return(Json(chartImageSrc)); }
public virtual async Task DoWork(CancellationToken cancellationToken, StatisticsBusiness business) { await Task.Delay(5000, cancellationToken); // do the work }