public ActionResult Index(DashboardDateTimeRange? dateTimeRange)
        {
            UserProfile profile = CurrentUserProfileOrNull;
            if (profile != null && !Session.StoreAdminVisitLogged())
            {
                profile.LastStoreAdminVisitDateTimeUtc = DateTime.UtcNow;
                GStoreDb.UserProfiles.Update(profile);
                GStoreDb.SaveChangesDirect();
                Session.StoreAdminVisitLogged(true);
            }

            ViewData.Add("DashboardDateTimeRange", dateTimeRange);
            return View("Index", this.StoreAdminViewModel);
        }
Exemple #2
0
        public static DateTime ToStartDateTimeUtc(this DashboardDateTimeRange value)
        {
            switch (value)
            {
            case DashboardDateTimeRange.Past15Minutes:
                return(DateTime.UtcNow.AddMinutes(-15));

            case DashboardDateTimeRange.PastHour:
                return(DateTime.UtcNow.AddHours(-1));

            case DashboardDateTimeRange.Past7Days:
                return(DateTime.UtcNow.AddDays(-7));

            case DashboardDateTimeRange.Past24Hours:
                return(DateTime.UtcNow.AddHours(-24));

            case DashboardDateTimeRange.Past48Hours:
                return(DateTime.UtcNow.AddHours(-48));

            case DashboardDateTimeRange.Past72Hours:
                return(DateTime.UtcNow.AddHours(-72));

            case DashboardDateTimeRange.Past30Days:
                return(DateTime.UtcNow.AddDays(-30));

            case DashboardDateTimeRange.Past60Days:
                return(DateTime.UtcNow.AddDays(-60));

            case DashboardDateTimeRange.Past90Days:
                return(DateTime.UtcNow.AddDays(-90));

            case DashboardDateTimeRange.Past6Months:
                return(DateTime.UtcNow.AddMonths(-6));

            case DashboardDateTimeRange.PastYear:
                return(DateTime.UtcNow.AddYears(-1));

            case DashboardDateTimeRange.AllTime:
                return(new DateTime(2000, 1, 1));

            default:
                throw new ApplicationException("Unknown DashboardDateTimeRange: " + value.ToString());
            }
        }
Exemple #3
0
 public static DateTime ToEndDateTimeUtc(this DashboardDateTimeRange value)
 {
     return(DateTime.UtcNow);
 }