public IActionResult ExportXml() { try { var xml = _exportManager.ExportCategoriesToXml(); return(File(Encoding.UTF8.GetBytes(xml), "application/xml", "categories.xml")); } catch (Exception exc) { ErrorNotification(exc); return(RedirectToAction("List")); } }
public async Task <IActionResult> ExportXml() { try { var xml = await _exportManager.ExportCategoriesToXml(await _categoryService.GetAllCategories(showHidden: true, storeId: _workContext.CurrentCustomer.StaffStoreId)); return(File(Encoding.UTF8.GetBytes(xml), "application/xml", "categories.xml")); } catch (Exception exc) { ErrorNotification(exc); return(RedirectToAction("List")); } }
public virtual ActionResult ExportXml() { if (!_permissionService.Authorize(StandardPermissionProvider.ManageCategories)) { return(AccessDeniedView()); } try { var xml = _exportManager.ExportCategoriesToXml(); return(new XmlDownloadResult(xml, "categories.xml")); } catch (Exception exc) { ErrorNotification(exc); return(RedirectToAction("List")); } }
public virtual IActionResult ExportXml() { if (!_permissionService.Authorize(StandardPermissionProvider.ManageCategories)) { return(AccessDeniedView()); } try { var xml = _exportManager.ExportCategoriesToXml(); return(File(Encoding.UTF8.GetBytes(xml), "application/xml", "categories.xml")); } catch (Exception exc) { ErrorNotification(exc); return(RedirectToAction("List")); } }
public ActionResult ExportXml() { if (!_permissionService.Authorize(StandardPermissionProvider.ManageCatalog)) { return(AccessDeniedView()); } try { var fileName = string.Format("categories_{0}.xml", DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss")); var xml = _exportManager.ExportCategoriesToXml(); return(new XmlDownloadResult(xml, "categories.xml")); } catch (Exception exc) { NotifyError(exc); return(RedirectToAction("List")); } }
/// <summary> /// Export category list to xml /// </summary> /// <returns>Result in XML format</returns> public string ExportCategoriesToXml() { return(_exportManager.ExportCategoriesToXml()); }