Esempio n. 1
0
        protected async Task <string> UploadDocumentsAsync(ReviewDocumentDto document)
        {
            List <string> files      = new List <string>();
            string        folderPath = await GetFolderPathAsync(document.Code);

            string uploadFolderPath = await SettingProvider.GetOrNullAsync(DocumentManagementSettings.UploadFilePath);

            if (document.Files != null && document.Files.Any())
            {
                foreach (IFormFile file in document.Files)
                {
                    string filePath = $"{folderPath}/{file.FileName}";
                    document.FolderName = folderPath.Replace(uploadFolderPath, string.Empty);
                    document.LinkFile   = $"/downloadfile/viewfile?sourcedoc={folderPath.Replace(folderPath, string.Empty)}/{file.FileName}";
                    files.Add(file.FileName);
                    await SaveAsAsync(filePath, file);
                }
            }

            if (document.AppendixFiles != null && document.AppendixFiles.Any())
            {
                int index = 0;
                foreach (IFormFile file in document.AppendixFiles)
                {
                    string filePath = $"{folderPath}/{file.FileName}";
                    await SaveAsAsync(filePath, file);

                    document.Appendixes[index].FolderName = folderPath.Replace(uploadFolderPath, string.Empty);
                    document.Appendixes[index].LinkFile   = $"/downloadfile/viewfile?sourcedoc={folderPath.Replace(folderPath, string.Empty)}/{file.FileName}";
                    index++;
                }
            }
            return(string.Join(";", files));
        }
Esempio n. 2
0
        public async Task <DocumentDto> ReviewAndReleaseAsync([FromForm] ReviewDocumentDto input)
        {
            var result = await _documentAppService.ReviewAsync(input);

            await _documentEmailSenderService.SendMailReviewAndReleaseAsync(result);

            return(result);
        }
Esempio n. 3
0
 public async Task <DocumentDto> ReviewAsync([FromForm] ReviewDocumentDto input)
 {
     return(await _documentAppService.ReviewAsync(input));
 }