public static void CreateReportFile(Report report, object fileContent, string fileName, string uploadFolder, string connectionName = "DatabaseConnection") { if (!string.IsNullOrEmpty(fileName) && fileContent != null) { File file = new File(); file.FileName = fileContent.SaveFile(fileName, uploadFolder); FileServices.Create(file); ReportFile reportFile = new ReportFile { ReportID = report.ReportID, FileID = file.FileID }; Create(reportFile); } }
public static void CreateDocumentFile(Document document, object fileContent, string fileName, string uploadFolder, string connectionName = "DatabaseConnection") { if (fileContent != null) { File file = new File { FileName = fileContent.SaveFile(fileName, uploadFolder) }; if (!string.IsNullOrEmpty(file.FileName)) { FileServices.Create(file); DocumentFile docFile = new DocumentFile { DocumentID = document.DocumentID, FileID = file.FileID }; Create(docFile); } } }