コード例 #1
0
ファイル: ExcelController.cs プロジェクト: Strongminds/kitos
        public HttpResponseMessage GetUsers(int organizationId, bool?exportUsers)
        {
            if (!AllowAccess(organizationId))
            {
                return(Forbidden());
            }
            const string filename = "OS2KITOS Brugere.xlsx";
            var          stream   = new MemoryStream();

            using (var file = File.OpenRead(_mapPath + filename))
                file.CopyTo(stream);

            _excelService.ExportUsers(stream, organizationId);
            stream.Seek(0, SeekOrigin.Begin);
            return(GetResponseMessage(stream, filename));
        }