Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        public DiaryIndexViewModel GetIndexModel(string username)
        {
            var indexModel = new DiaryIndexViewModel
            {
                InitialOpen = true
            };

            indexModel.HomePageStatistics = this.GetStatistics(DateTime.Now.AddMonths(-1), DateTime.Now, username);

            return(indexModel);
        }