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"));
     }
 }
예제 #2
0
        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"));
            }
        }
예제 #3
0
        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"));
            }
        }
예제 #4
0
        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"));
            }
        }
예제 #6
0
 /// <summary>
 /// Export category list to xml
 /// </summary>
 /// <returns>Result in XML format</returns>
 public string ExportCategoriesToXml()
 {
     return(_exportManager.ExportCategoriesToXml());
 }