コード例 #1
0
        public async Task <IActionResult> DownloadFileHome1(string ProjectNumber)
        {
            ModelMenuHome1_DownloadFile e = await _IDocMenuHomeService.DownloadFileHome1Async(ProjectNumber);

            if (e != null)
            {
                return(Ok(e));
            }
            else
            {
                return(BadRequest());
            }
        }
コード例 #2
0
        public async Task <ModelMenuHome1_DownloadFile> DownloadFileHome1Async(string project_number)
        {
            var file_download = await _IDocMenuHomeRepository.GetFileDownloadHome1Async(project_number);

            if (file_download != null)
            {
                string fileZipName = project_number + "-" + DateTime.Now.ToString("ddMMyyHHtt") + ".zip";

                ModelMenuHome1_DownloadFile download_file = new ModelMenuHome1_DownloadFile();

                download_file.filename   = fileZipName;
                download_file.filebase64 = ServerDirectorys.DownloadFileHome1(_IEnvironmentConfig.PathArchive, _IEnvironmentConfig.PathDocument, FolderDocument.menuA1,
                                                                              project_number, fileZipName, file_download.file1name, file_download.file2name,
                                                                              file_download.file3name, file_download.file4name, file_download.file5name);
                if (download_file.filebase64 != null)
                {
                    return(download_file);
                }
            }
            return(null);
        }