Beispiel #1
0
        public ActionResult DownloadImportTemplate(string name)
        {
            string fileName;

            var fileStream = ImportExportHelper.GetTemplate(name, "Xlsx", out fileName);

            if (fileStream != null)
            {
                return(File(fileStream,
                            "application/excel",
                            fileName));
            }
            return(new EmptyResult());
        }
Beispiel #2
0
        public ActionResult GetTemplate(string name, string type = "Xlsx")
        {
            string fileName;
            string folderName = Server.MapPath(Settings.Current["TemporaryFolderForImportExport"]);

            var fileStream = ImportExportHelper.GetTemplate(name, type, out fileName, folderName);

            if (fileStream != null)
            {
                return(File(fileStream,
                            "application/excel",
                            fileName));
            }
            return(new EmptyResult());
        }