public virtual FileResult Excel()
        {
            var client = _clients.GetByUserId(_identity.Id);

            var stream = _excel.Get(client.ClientId, _identity.Language);

            return(File(stream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "calculation.xlsx"));
        }
Beispiel #2
0
        public IReadOnlyDictionary <string, FileHolder> GetExcels(long clientId, string[] languages)
        {
            var clientData = _clients.Get(clientId);
            var name       = GetName(clientData);

            var files = languages
                        .Distinct()
                        .ToDictionary(
                x => x,
                language =>
            {
                using (var stream = _excel.Get(clientId, language))
                {
                    return(new FileHolder
                    {
                        Data = stream.ToArray(),
                        Name = name
                    });
                }
            });

            return(files);
        }