public ActionResult DownloadExcel(TextOptionImportPageViewModel textOptionImportPageViewModel) { try { var dataSet = _textOptionImportPageViewModelBuilder.CreateTextOptions(textOptionImportPageViewModel); return(CreateWorkBook(dataSet, textOptionImportPageViewModel.TextOption)); } catch (Exception ex) { return(RedirectToAction(nameof(Index), new { ex.Message, Success = false })); } }
public ActionResult Index(TextOptionImportPageViewModel textOptionImportPageViewModel) { try { _textOptionImportPageViewModelBuilder.ImportTextOptions(textOptionImportPageViewModel, GetFileContent()); return(RedirectToAction(nameof(Index), new { Message = $"The import of Text Option: \"{textOptionImportPageViewModel.TextOptionName}\" was successful in Area: \"{textOptionImportPageViewModel.Area}\"!", Success = true })); } catch (Exception ex) { return(RedirectToAction(nameof(Index), new { ex.Message, Success = false })); } }