public async Task <ActionResult> GroupDownloadAjax(Guid id, eFileFormat fileFormat, string searchQueryString = null, eLookupSearchSource?searchSource = null)
        {
            var model = new ProgressDto();

            try
            {
                model = await _groupDownloadService.GetDownloadGenerationProgressAsync(id, User);
            }
            catch (Exception ex)
            {
                if (ex.Message.StartsWith("The API returned 404 Not Found"))
                {
                    // if the file no longer exists (user refreshes the page post download etc) then the api returns a 404 and throws an error. This allows for a more graceful response
                    model.Error = "Download process not found for associated id";
                }
                else
                {
                    throw;
                }
            }

            if (model.HasErrored)
            {
                return(Json(JsonConvert.SerializeObject(new
                {
                    status = "error", redirect = "/Groups/Search/Download"
                })));
            }

            return(Json(JsonConvert.SerializeObject(new
            {
                status = model.IsComplete, redirect = "/Groups/Search/Download"
            })));
        }
        public async Task <ActionResult> Download(Guid id, eFileFormat fileFormat, int step, int totalSteps, string searchQueryString = null, eLookupSearchSource?searchSource = null)
        {
            var model = await _governorDownloadService.GetDownloadGenerationProgressAsync(id, User);

            var viewModel = new GovernorSearchDownloadGenerationProgressViewModel(model)
            {
                FileFormat        = fileFormat,
                SearchSource      = searchSource,
                SearchQueryString = searchQueryString,
                Step       = step,
                TotalSteps = totalSteps
            };

            if (model.HasErrored)
            {
                throw new Exception($"Download generation failed; Underlying error: '{model.Error}'");
            }

            if (!model.IsComplete)
            {
                return(View("Downloads/PreparingFilePleaseWait", viewModel));
            }

            viewModel.Step++;

            return(View("Downloads/ReadyToDownload", viewModel));
        }
Exemplo n.º 3
0
        public async Task <ActionResult> Download(Guid id, eFileFormat fileFormat, int step, int totalSteps, string searchQueryString = null, eLookupSearchSource?searchSource = null)
        {
            var model = new ProgressDto();

            try
            {
                model = await _governorDownloadService.GetDownloadGenerationProgressAsync(id, User);
            }
            catch (Exception ex)
            {
                if (ex.Message.StartsWith("The API returned 404 Not Found"))
                {
                    // if the file no longer exists (user refreshes the page post download etc) then the api returns a 404 and throws an error. This allows for a more graceful response
                    model.Error = "Download process not found for associated id";
                }
                else
                {
                    throw;
                }
            }

            var viewModel = new GovernorSearchDownloadGenerationProgressViewModel(model)
            {
                FileFormat        = fileFormat,
                SearchSource      = searchSource,
                SearchQueryString = searchQueryString,
                Step       = step,
                TotalSteps = totalSteps
            };

            if (model.HasErrored)
            {
                return(View("Downloads/DownloadError", new DownloadErrorViewModel {
                    SearchQueryString = searchQueryString, SearchSource = searchSource, NeedsRegenerating = true
                }));
            }

            viewModel.Step++;

            if (!model.IsComplete)
            {
                return(View("Downloads/PreparingFilePleaseWait", viewModel));
            }

            viewModel.Step++;

            return(View("Downloads/ReadyToDownload", viewModel));
        }
Exemplo n.º 4
0
        public async Task <ActionResult> Download(Guid id, eFileFormat fileFormat, string searchQueryString = null, eLookupSearchSource?searchSource = null)
        {
            var model = await _establishmentDownloadService.GetDownloadGenerationProgressAsync(id, User);

            var viewModel = new EstablishmentSearchDownloadGenerationProgressViewModel(model, model.IsComplete ? 4 : 3)
            {
                FileFormat        = fileFormat,
                SearchSource      = searchSource,
                SearchQueryString = searchQueryString
            };

            if (model.HasErrored)
            {
                throw new Exception($"Download generation failed; Underlying error: '{model.Error}'");
            }

            if (!model.IsComplete)
            {
                return(View("Downloads/PreparingFilePleaseWait", viewModel));
            }

            return(View("Downloads/ReadyToDownload", viewModel));
        }
 public SearchChangeHistoryDownloadPayload(eFileFormat fileFormat)
 {
     FileFormat = fileFormat;
 }
Exemplo n.º 6
0
 public IQuery ExportFormattedText(string File, eFileFormat Encoding, string separatorChar, string quoteChar, string lineTerminatorChar, bool keepLineFeeds)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 7
0
 public IQuery Export(string File, eFileFormat Format, eTextEncoding Encoding, bool withHeaders)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 8
0
 public IQuery ImportString(string Content, eFileFormat Format, long startrow, long endrow, long startcol, long endcol, long insertafter)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 9
0
 public IQuery ImportString(string Content, eFileFormat Format)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 10
0
 public IQuery Import(string File, eFileFormat Format)
 {
     throw new NotImplementedException();
 }