public async Task <long> UpdateExternalDocumentAsync(ExternalDocumentDto externalDocumentDto) { var externalDocument = new ExternalDocument(); Mapper.Map(externalDocumentDto, externalDocument); var rowsUpdated = await externalDocumentRepository.UpdateExternalDocumentAsync(externalDocument, externalDocumentDto.MappingScheme); return(rowsUpdated); }
public async Task <long> UpdateExternalDocumentAsync(ExternalDocument externalDocument, string mappingScheme) { externalDocumentMappingSchemeRegistrator.Register(); var updatedExternalDocument = unitOfWork.Add(externalDocument, mappingScheme); await unitOfWork.SaveAsync(); return(updatedExternalDocument.Id); }
public static ExternalDocument ToExternalDocument(this GEN_FILE genFile) { var document = new ExternalDocument(); document.Data = genFile.Data; document.FileSize = genFile.File_Size; document.Name = genFile.Title; document.ShortName = genFile.Doc_Num; document.FileName = genFile.File_Name; return(document); }
private static IDocumentationRow StockRow() { string validationFile = Path.Combine(validation, "Stock", "Stock.apsimx"); IDocumentationFile paramsDoc = new ParamsDocsFromFile(validationFile, $"Stock-parameters.pdf", options, "[Supplement]"); IDocumentationCell paramsCell = new DocumentationCell(paramsDoc); IDocumentationFile grazPlanDoc = new ExternalDocument("GRAZPLAN Animal Biology Model", grazPlan); IDocumentationCell detailsCell = new DocumentationCell(grazPlanDoc); return(CustomDocsRow("Stock", validationFile.ToEnumerable(), "Stock.pdf", new [] { paramsCell, detailsCell })); }
private static IDocumentationRow ClemDocsRow() { string clem = Path.Combine(examples, "CLEM"); string croppingFile = Path.Combine(clem, "CLEM_Example_Cropping.apsimx"); string grazingFile = Path.Combine(clem, "CLEM_Example_Grazing.apsimx"); IDocumentationFile scienceDocs = new ExternalDocument("Science Documentation", "https://www.apsim.info/clem"); IDocumentationFile croppingExample = new DocsFromFile(croppingFile, "CLEM_Example_Cropping.pdf", options); IDocumentationFile grazingExample = new DocsFromFile(grazingFile, "CLEM_Example_Grazing.pdf", options); IEnumerable <IDocumentationCell> cells = new IDocumentationCell[3] { new DocumentationCell(new[] { scienceDocs }), new DocumentationCell(new[] { croppingExample }), new DocumentationCell(new[] { grazingExample }) }; return(new DocumentationRow("CLEM", cells)); }
private static IDocumentationRow AgPastureDocsRow(string name, string resourceFile, string validationFile, string outFile, bool documentSpeciesTable) { string speciesFile = Path.Combine(validation, "AgPasture", "SpeciesTable.apsimx"); IDocumentationFile speciesParams = new DocsFromFile(speciesFile, "SpeciesTable.pdf", options); IDocumentationFile scienceDocs = new ExternalDocument("Science Documentation", agpScience); List <IDocumentationFile> files = new List <IDocumentationFile>(); files.Add(scienceDocs); if (documentSpeciesTable) { files.Add(speciesParams); } IDocumentationCell detailsCells = new DocumentationCell(files); return(StandardDocsRow(name, resourceFile, validationFile, outFile, detailsCells.ToEnumerable())); }