public ActionResult ExportDocuments()
 {
     try
     {
         byte[] file = _importExportManager.ExportDocumentsToExcel();
         TempData["export-status"] = "Documents successfully exported.";
         return(File(file, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "MrCMS-Documents-" + DateTime.UtcNow + ".xlsx"));
     }
     catch (Exception ex)
     {
         CurrentRequestData.ErrorSignal.Raise(ex);
         TempData["export-status"] = "Documents exporting has failed. Please try again and contact system administration if error continues to appear.";
         return(RedirectToAction("Documents"));
     }
 }
Exemple #2
0
 public ActionResult ExportDocuments()
 {
     try
     {
         byte[] file = _importExportManager.ExportDocumentsToExcel();
         TempData["export-status"] = "Documents successfully exported.";
         return(File(file, ImportExportManager.XlsxContentType,
                     "MaterialCMS-Documents-" + DateTime.UtcNow + ".xlsx"));
     }
     catch (Exception ex)
     {
         CurrentRequestData.ErrorSignal.Raise(ex);
         TempData["export-status"] =
             "Documents exporting has failed. Please try again and contact system administration if error continues to appear.";
         return(RedirectToAction("Documents"));
     }
 }