示例#1
0
        // GET: /Graph/DownloadClient
        public ActionResult DownloadClient()
        {
            Guid userId;

            if (UserIdRepository.TryGetUserId(out userId))
            {
                ViewBag.UploadId = userId;
            }

            return(View());
        }
示例#2
0
        public Data GetByDay(long msSinceEpoch, int minutesOffset)
        {
            Guid userId;

            if (!UserIdRepository.TryGetUserId(out userId))
            {
                return(new Data());
            }

            DateTime utcStart = new DateTime(1970, 1, 1).AddTicks(msSinceEpoch * 10000);
            DateTime utcEnd   = utcStart.AddDays(1);

            var repo       = new UsageRepository();
            var dataRows   = repo.GetRows(userId, utcStart, utcEnd);
            var dailyUsage = dataRows.ToDaily(minutesOffset);
            var uiUsage    = dailyUsage.ToUI();

            return(uiUsage);
        }
示例#3
0
        public IEnumerable <TableData> GetByDay(long msSinceEpoch, int minutesOffset)
        {
            Guid            userId;
            List <UsageRow> dataRows;

            if (!UserIdRepository.TryGetUserId(out userId))
            {
                dataRows = new List <UsageRow>();
            }
            else
            {
                DateTime utcStart = new DateTime(1970, 1, 1).AddTicks(msSinceEpoch * 10000);
                DateTime utcEnd   = utcStart.AddDays(1);

                var repo = new UsageRepository();
                dataRows = repo.GetRows(userId, utcStart, utcEnd);
            }

            return(dataRows.ToTableData());
        }