public ActionResult ListAccessHistory(DateTime?startDate, DateTime?endDate, Guid userId,
                                              AccessType accessType = AccessType.All, int page = 1)
        {
            var range = new DateRange
            {
                StartDate = startDate,
                EndDate   = endDate
            };

            var historyService = new HistoryService(_context, new DefaultDateTimeHumanizeStrategy());

            return(Json(AccessViewModel.FromEntityList(historyService.SearchAccess(range, page, userId, accessType)),
                        JsonRequestBehavior.AllowGet));
        }
        public ActionResult AccessHistory()
        {
            const AccessType accessType = AccessType.File;

            ViewBag.AccessTypes = new SelectList(accessType.ToDataSource <AccessType>(), "Key", "Value");

            var range = new DateRange
            {
                StartDate = DateTime.Now.AddMonths(-1),
                EndDate   = DateTime.Now
            };

            var historyService = new HistoryService(_context, new DefaultDateTimeHumanizeStrategy());

            return(View(
                       AccessViewModel.FromEntityList(historyService.SearchAccess(range, 1, _loggedUser.Id, AccessType.All))));
        }