Example #1
0
        private FileHolder[] GeAllFiles(long applicationId, long?awbId)
        {
            var files = new List <FileHolder>();

            var types = Enum.GetValues(typeof(ApplicationFileType));

            foreach (ApplicationFileType type in types)
            {
                var names = _applicationFiles.GetNames(applicationId, type);
                foreach (var name in names)
                {
                    var holder = _applicationFiles.Get(name.Id);

                    files.Add(holder);
                }
            }

            if (awbId.HasValue)
            {
                var gtdFile           = _awbFiles.GetGTDFile(awbId.Value);
                var gtdAdditionalFile = _awbFiles.GTDAdditionalFile(awbId.Value);

                if (gtdFile != null)
                {
                    files.Add(gtdFile);
                }
                if (gtdAdditionalFile != null)
                {
                    files.Add(gtdAdditionalFile);
                }
            }

            return(files.ToArray());
        }
        public virtual FileResult Download(long id)
        {
            var file = _files.Get(id);

            return(file.GetFileResult());
        }