Example #1
0
        public ActionResult GetDailyStatsDataRows(DateTime?date, ReportEnums.eDailyStatsFields field)
        {
            if (date == null)
            {
                return(Content("<h3>Date required</h3>"));
            }

            switch (field)
            {
            case ReportEnums.eDailyStatsFields.UsersCreated:
            case ReportEnums.eDailyStatsFields.WixUsersCreated:
            case ReportEnums.eDailyStatsFields.UserLogins:
            case ReportEnums.eDailyStatsFields.AuthorLogins:
            case ReportEnums.eDailyStatsFields.ReturnUsersLogins:
                var users = _reportServices.GetDailyStatsUserData((DateTime)date, field);
                return(PartialView("Report/_DailyStatsUserData", users));

            case ReportEnums.eDailyStatsFields.ItemsCreated:
            case ReportEnums.eDailyStatsFields.ItemsPublished:
                var items = _reportServices.GetDailyStatsItemData((DateTime)date, field);
                return(PartialView("Report/_DailyStatsItemData", items));

            case ReportEnums.eDailyStatsFields.StoresCreated:
            case ReportEnums.eDailyStatsFields.WixStoresCreated:
                var stores = _reportServices.GetDailyStatsStoreData((DateTime)date, field);
                return(PartialView("Report/_DailyStatsStoreData", stores));

            case ReportEnums.eDailyStatsFields.ItemsPurchased:
            case ReportEnums.eDailyStatsFields.FreeItemsPurchased:
                var lines = _reportServices.GetDailyStatsPurchaseData((DateTime)date, field);
                return(PartialView("Report/_DailyStatsPurchaseData", lines));

            case ReportEnums.eDailyStatsFields.TotalVideos:
            case ReportEnums.eDailyStatsFields.TotalUsedVideos:
                var videos = _reportServices.GetDailyStatsVideoData((DateTime)date, field);
                return(PartialView("Report/_DailyStatsVideoData", videos.OrderBy(x => x.user.FullName).ToList()));
            }

            return(Content("d=" + date + " f=" + field));
        }