Beispiel #1
0
        public ActionResult BlobSetActivity(BlobSetActivityViewModel model)
        {
            DateTime fromdate = DateTimeHelper.FromLocalTime(model.FromDate);
            DateTime todate   = DateTimeHelper.FromLocalTime(NormalizeToDate(model.ToDate));

            BlobSet set = null;

            if (!string.IsNullOrEmpty(model.SelectedBlobSetName))
            {
                set = this.blobSetService.GetBlobSetByName(model.SelectedBlobSetName);

                if (set == null)
                {
                    this.ModelState.AddModelError("SelectedBlobSetName", "Unknown Blob Set");
                }
            }

            if (this.ModelState.IsValid)
            {
                var totalPages = 0;
                if (set == null)
                {
                    model.BlobSetEvents = this.reportService.GetBlobSetEvents(fromdate, todate, EventType.View, DefaultPageSize, model.CurrentPage, out totalPages);
                }
                else
                {
                    model.BlobSetEvents = this.reportService.GetBlobSetEventsByBlobSet(fromdate, todate, EventType.View, set.BlobSetId, DefaultPageSize, model.CurrentPage, out totalPages);
                }

                model.TotalPages = totalPages;
            }

            return(View(model));
        }
Beispiel #2
0
        public ActionResult BlobSetActivity()
        {
            var model = new BlobSetActivityViewModel();

            DateTime now      = DateTime.UtcNow;
            DateTime localnow = DateTimeHelper.ToLocalTime(now);

            model.FromDate = localnow.AddDays(-7);
            model.ToDate   = localnow;

            model.CurrentPage = 1;

            DateTime fromdate = DateTimeHelper.FromLocalTime(model.FromDate);
            DateTime todate   = DateTimeHelper.FromLocalTime(NormalizeToDate(model.ToDate));

            var totalPages = 0;

            model.BlobSetEvents = this.reportService.GetBlobSetEvents(fromdate, todate, EventType.View, DefaultPageSize, model.CurrentPage, out totalPages);
            model.TotalPages    = totalPages;

            return(View(model));
        }