From 4c4f4d52d2393210908fb6d39db2eb9f1f454ec4 Mon Sep 17 00:00:00 2001 From: mschill Date: Fri, 18 Jul 2025 13:26:16 -0400 Subject: [PATCH] C2025-024 Electronic Procedures Phase 2 - XML Export Code refactor and added comment --- PROMS/VEPROMS User Interface/dlgExportImport.cs | 12 ++++-------- PROMS/VEPROMS User Interface/dlgExportImportEP.cs | 1 + 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/PROMS/VEPROMS User Interface/dlgExportImport.cs b/PROMS/VEPROMS User Interface/dlgExportImport.cs index 1c52f404..c4bc8d6c 100644 --- a/PROMS/VEPROMS User Interface/dlgExportImport.cs +++ b/PROMS/VEPROMS User Interface/dlgExportImport.cs @@ -1209,14 +1209,10 @@ namespace VEPROMS // See if there is an existing format file that was created as a copy. If so, check if the passed in format's // config is the same as an existing 'Copy of' format - if so, use rather than importing the same format as // defined by config. - foreach (var existname in existingFormat.Where(existname => existname.Key.Contains(name))) + foreach (string cpy in existingFormat.Select(existname => existname.Key).Where(existname => existname.Contains(name) && existname.StartsWith("Copy") && existname.Contains("of " + name))) { - string cpy = existname.Key; - if (cpy.StartsWith("Copy") && cpy.Contains("of " + name)) - { - FormatInfo exFI = FormatInfo.Get(existingFormat[cpy]); - if (exFI.Config == config) return cpy; - } + FormatInfo exFI = FormatInfo.Get(existingFormat[cpy]); + if (exFI.Config == config) return cpy; } return null; } @@ -3110,7 +3106,7 @@ namespace VEPROMS bool hasNewROID = (content.MyGrid.Data.Contains(glookFor)); if (hasNewROID) content.MyGrid.Data = content.MyGrid.Data.Replace(glookFor, greplaceWith); - else if (!hasNewROID && glookFor.Contains("0041") && glookFor.Contains("FFFF")) + else if (glookFor.Contains("0041") && glookFor.Contains("FFFF")) { string newGlookFor = glookFor; newGlookFor = newGlookFor.Replace("0041", "0000"); diff --git a/PROMS/VEPROMS User Interface/dlgExportImportEP.cs b/PROMS/VEPROMS User Interface/dlgExportImportEP.cs index 87a746c8..a422c743 100644 --- a/PROMS/VEPROMS User Interface/dlgExportImportEP.cs +++ b/PROMS/VEPROMS User Interface/dlgExportImportEP.cs @@ -313,6 +313,7 @@ namespace VEPROMS return xroid; } + //overridden - used to set the RO location for RO Images that are not in annotations protected override void SetROLocation(ref XmlElement xindivid, ROFSTLookup.rochild roc, RODbInfo rodb, bool isMulti) { string imgfile = GetROImageFileLocation(roc, rodb, isMulti);