public ActionResult NoticePanel()
        {
            var repo    = new NoticeRepository(_context);
            var notices = repo.ListNotSeenNotices(_loggedUser.Id);
            var dateTimeHumanizerStrategy = new DefaultDateTimeHumanizeStrategy();

            return(PartialView("_NoticePanel", NoticeViewModel.FromEntityList(notices, dateTimeHumanizerStrategy)));
        }
        public ActionResult ListNoticeHistory(DateTime?startDate, DateTime?endDate,
                                              NoticeType noticeType = NoticeType.All, int page = 1)
        {
            var range = new DateRange
            {
                StartDate = startDate,
                EndDate   = endDate
            };

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

            return(Json(
                       NoticeViewModel.FromEntityList(historyService.SearchNotices(range, page, _loggedUser.Id, noticeType)),
                       JsonRequestBehavior.AllowGet));
        }
        public ActionResult Index()
        {
            const NoticeType notivceType = NoticeType.Public;

            ViewBag.NoticeTypes = new SelectList(notivceType.ToDataSource <NoticeType>(), "Key", "Value");
            var range = new DateRange
            {
                StartDate = DateTime.Now.AddMonths(-1),
                EndDate   = DateTime.Now
            };
            var historyService = new HistoryService(_context, new DefaultDateTimeHumanizeStrategy());

            return(View(
                       NoticeViewModel.FromEntityList(historyService.SearchNotices(range, 1, _loggedUser.Id, NoticeType.All))));
        }