/// <summary> /// Export the patients to an excel file /// </summary> public void ExportPatients(FileFormat fileFormat) { var patients = personWithCovidRepository.GetAllPeopleWithCovid(); string fileName = fileRepository.CreateFileName(fileFormat); string completePath = fileRepository.ReturnCompletePath(mainConfiguration.Configuration.DirectoryToSaveFiles, fileName); if (!fileRepository.DirectoryExists(mainConfiguration.Configuration.DirectoryToSaveFiles)) { fileRepository.CreateDirectory(mainConfiguration.Configuration.DirectoryToSaveFiles); } switch (fileFormat) { case FileFormat.xlsx: CreateXlsxFile(patients, completePath); break; case FileFormat.txt: CreateTxtFile(patients, completePath); break; default: screenService.ShowErrorCreatingFile(completePath); break; } }
public virtual ActionResult CreateDirectory(string path, string name) { FileRepository.CreateDirectory(path, name); return(RedirectToAction("Index", "Upload", new { path })); }