예제 #1
0
        public ActionResult View(int?id = null)
        {
            if (!_authorizer.Authorize(ContentSyncPermissions.SnapshotManager, T("You need the {0} permission to do this.", ContentSyncPermissions.SnapshotManager.Name)))
            {
                return(new HttpUnauthorizedResult());
            }

            SnapshotRecord record = null;

            if (id.HasValue)
            {
                record = _snapshotService.GetSnaphot(id.Value);
            }

            if (record == null)
            {
                record = new SnapshotRecord
                {
                    TimeTaken = _clock.UtcNow,
                    Data      = _contentExportService.GetContentExportText()
                };
            }

            return(View(record));
        }
        public ActionResult View(int?id = null)
        {
            SnapshotRecord record = null;

            if (id.HasValue)
            {
                record = _snapshotService.GetSnaphot(id.Value);
            }

            if (record == null)
            {
                record = new SnapshotRecord {
                    TimeTaken = _clock.UtcNow,
                    Data      = _contentExportService.GetContentExportFilePath()
                };
            }

            return(View(record));
        }