public IActionResult Index(DiaryIndexViewModel model) { if (this.ModelState.IsValid) { var customPeriodStatisticsModel = this.diaryService.GetStatistics(model.StartCustomDate, model.EndCustomDate, this.User.Identity.Name); model.CustomPeriodStatistics = customPeriodStatisticsModel; } return(View(model)); }
public DiaryIndexViewModel GetIndexModel(string username) { var indexModel = new DiaryIndexViewModel { InitialOpen = true }; indexModel.HomePageStatistics = this.GetStatistics(DateTime.Now.AddMonths(-1), DateTime.Now, username); return(indexModel); }