예제 #1
0
        //NOP 3.830
        public ActionResult ExportXlsx()
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageDiscounts))
            {
                return(AccessDeniedView());
            }

            try
            {
                var bytes = _exportManager.ExportGiftCardsToXlsx(_giftCardService.GetAllGiftCards());

                return(File(bytes, MimeTypes.TextXlsx, "giftcards.xlsx"));
            }
            catch (Exception exc)
            {
                ErrorNotification(exc);
                return(RedirectToAction("List"));
            }
        }