B2024-025 Older Parent/Child procedure sets use applicability tokens that do not include the “U-“ prefix.

This commit is contained in:
2024-05-06 13:49:03 -04:00
parent 89814777b4
commit c865b67398
5 changed files with 79 additions and 40 deletions

View File

@@ -3583,6 +3583,9 @@ namespace Volian.Controls.Library
private string ResolveUnitApp(DocVersionInfo dvi, string str)
{
if (dvi == null) return str;
// B2024-025 - process all of the applicability token (<U-xxx>, <U>, <ID>)
str = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(dvi, str);
// look for un-resolved tokens and replace less/greater than chars with "*?" and "?*" respectively
string tmp = str.ToUpper();
int sindx = tmp.IndexOf("<U");
int eindx = tmp.IndexOf(">", sindx + 1);
@@ -3591,21 +3594,34 @@ namespace Volian.Controls.Library
{
reptmp = str.Substring(sindx, eindx - sindx + 1);
tmp = reptmp.ToUpper();
if (tmp == "<U>") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Number);
else if (tmp == "<U-TEXT>") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Text);
else if (tmp == "<U-NUMBER>") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Number);
else if (tmp == "<U-NAME>") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Name);
else if (tmp == "<U-ID>") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_ID);
// B2021-145: For applicability, the tree view & pdf file name are not getting resolved when using any of the <20>OTHER<45> tokens
else if (tmp == "<U-OTHERTEXT>") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Text);
else if (tmp == "<U-OTHERNUMBER>") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Number);
else if (tmp == "<U-OTHERNAME>") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Name);
else if (tmp == "<U-OTHERID>") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_ID);
else str = str.Replace(reptmp, tmp.Replace("<", "*?").Replace(">", "?*"));
str = str.Replace(reptmp, tmp.Replace("<", "*?").Replace(">", "?*")); // unresolved token
tmp = str.ToUpper();
sindx = tmp.IndexOf("<U");
eindx = tmp.IndexOf(">", sindx + 1);
}
//string tmp = str.ToUpper();
//int sindx = tmp.IndexOf("<U");
//int eindx = tmp.IndexOf(">", sindx + 1);
//string reptmp;
//while (sindx > -1 && eindx > -1) // B2022-007 added while loop to process more than one <U- RO value
//{
// reptmp = str.Substring(sindx, eindx - sindx + 1);
// tmp = reptmp.ToUpper();
// if (tmp == "<U>") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Number);
// else if (tmp == "<U-TEXT>") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Text);
// else if (tmp == "<U-NUMBER>") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Number);
// else if (tmp == "<U-NAME>") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Name);
// else if (tmp == "<U-ID>") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_ID);
// // B2021-145: For applicability, the tree view & pdf file name are not getting resolved when using any of the <20>OTHER<45> tokens
// else if (tmp == "<U-OTHERTEXT>") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Text);
// else if (tmp == "<U-OTHERNUMBER>") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Number);
// else if (tmp == "<U-OTHERNAME>") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Name);
// else if (tmp == "<U-OTHERID>") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_ID);
// else str = str.Replace(reptmp, tmp.Replace("<", "*?").Replace(">", "?*"));
// tmp = str.ToUpper();
// sindx = tmp.IndexOf("<U");
// eindx = tmp.IndexOf(">", sindx + 1);
//}
return str;
}
// C2021-018 used to display Alarm Point Table RO values in the editor