示例#1
0
        public ActionResult Login(string documentName, string bookmark)
        {
            if (_validation.CanValidate(parseBrowserType(), parseBitVersion(), documentName))
            {
                if (SessionModel.Has()) return redirect(documentName, bookmark, SessionModel.Get());
                return View("Login");
            }

            var error = _validation.GetValidatorError(parseBrowserType(), parseBitVersion(), documentName);
            var errorModel = new ErrorModel() {Message = error.ErrorMessage};
            return View("Error", errorModel);
        }
示例#2
0
        public ActionResult Get(string reportAndGroupId)
        {
            var report = _reportService.GetReportById(GetReportId(reportAndGroupId), GetGroupId(reportAndGroupId));
            //var testResult = new ActionResult()
            if (report.IsValid)
            {
                var result = (ActionResult)new FilePathResult(report.GetFilePath() + report.GetFileName(), report.GetFileType()){FileDownloadName = report.GetFileName()};
                return result;
            }

            var errorModel = new ErrorModel { Message = "We're sorry:  You have requested a report which does not exist or which you do not have permission to view." };
            return View("Error", errorModel);
        }
示例#3
0
        public ActionResult Get(int reportId)
        {
            // TODO: Future version will need to input GroupId based on credentials passed from the http request
            var report = _reportService.GetReportById(reportId, 3);
            //var testResult = new ActionResult()
            if (report.IsValid)
            {
                var result = (ActionResult)new FilePathResult(report.GetFilePath() + report.GetFileName(), report.GetFileType()){FileDownloadName = report.GetFileName()};
                return result;
            }

            var errorModel = new ErrorModel { Message = "We're sorry:  You have requested a report which does not exist or which you do not have permission to view." };
            return View("Error", errorModel);
        }