B2022-072: Unit Designators not resolve on import of procedure set

This commit is contained in:
Kathy Ruffing 2023-11-14 08:51:39 -05:00
parent 6bee941a8a
commit 33881adca5

View File

@ -2001,19 +2001,34 @@ namespace VEPROMS
Application.DoEvents();
string formatFileName = (dvi.MyFormat != null) ? dvi.MyFormat.Name : "";
XmlElement xe = xn.OwnerDocument.CreateElement(nodename);
// B2022-072: if the exported docversion doesn't have the format set, look up folder tree to find the format used
int tmpFormatID = (dvi.FormatID != null) ? (int)dvi.FormatID : 0;
FolderInfo fi = dvi.MyFolder;
while (formatFileName == "" && fi != null)
{
if (fi.FormatID != null && fi.FormatID != 0)
{
formatFileName = (fi.MyFormat != null) ? fi.MyFormat.Name : "";
tmpFormatID = (fi.FormatID != null) ? (int)fi.FormatID : 0;
break;
}
fi = fi.MyParent;
}
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "versionid", dvi.VersionID.ToString()));
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "folderid", dvi.FolderID.ToString()));
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "versiontype", dvi.VersionType.ToString()));
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "name", dvi.Name));
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "title", dvi.Title));
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "itemid", dvi.ItemID.ToString()));
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "formatid", dvi.FormatID.ToString()));
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "formatid", tmpFormatID.ToString()));//dvi.FormatID.ToString()));
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", dvi.Config));
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", dvi.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")));
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", dvi.UserID.ToString()));
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "formatfilename", formatFileName));
xn.AppendChild(xe);
if (!ValidDocVersionAssociation(dvi)) return; // bug fix: B2017-082 don't export if no RO Path
if (dvi.DocVersionAssociationCount > 0)
foreach (AssociationInfo ai in dvi.DocVersionAssociations)
ExportAssociation(xe, ai, "association");