diff --git a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs b/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs index cc990efa..727e3e47 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs @@ -898,33 +898,43 @@ namespace VEPROMS.CSLA.Library } } private Dictionary _dicROAPID = null; - public string GetROValueByAccPagID(string accPageID, string spDefault, string igDefault) + public rochild? GetROChildByAccPageID(string accPageID, string spDefault, string igDefault) { rochild? child = GetRoChildByAccPagID(accPageID, spDefault, igDefault); - if (child == null) return null; + if (child == null) + { + if(Regex.IsMatch(accPageID, @".*\.[A-Z]")) + { + string accpage = accPageID.Substring(0, accPageID.Length - 3); + int index = accPageID.Substring(accPageID.Length - 2, 1)[0] - 'A'; + child = GetRoChildByAccPagID(accpage, spDefault, igDefault); + if (child == null) return null; + if (((rochild)child).children != null && ((rochild)child).children.Length > 0 && ((rochild)child).children.Length > index) + return ((rochild)child).children[index]; + } + return null; + } if (((rochild)child).children != null && ((rochild)child).children.Length > 0) - return ((rochild)child).children[0].value; - string val = ((rochild)child).value; - if (val != null) return val; + return ((rochild)child).children[0]; return null; } + public string GetROValueByAccPagID(string accPageID, string spDefault, string igDefault) + { + rochild? child = GetROChildByAccPageID(accPageID, spDefault, igDefault); + if (child == null) return null; + return ((rochild)child).value; + } public int? GetROTypeByAccPagID(string accPageID, string spDefault, string igDefault) { - rochild? child = GetRoChildByAccPagID(accPageID, spDefault, igDefault); + rochild? child = GetROChildByAccPageID(accPageID, spDefault, igDefault); if (child == null) return null; - if (((rochild)child).children != null && ((rochild)child).children.Length > 0) - return ((rochild)child).children[0].type; return ((rochild)child).type; - return null; } public string GetROIDByAccPagID(string accPageID, string spDefault, string igDefault) { - rochild? child = GetRoChildByAccPagID(accPageID, spDefault, igDefault); + rochild? child = GetROChildByAccPageID(accPageID, spDefault, igDefault); if (child == null) return null; - if (((rochild)child).children != null && ((rochild)child).children.Length > 0) - return ((rochild)child).children[0].roid; return ((rochild)child).roid; - return null; } public rochild? GetRoChildByAccPagID(string accPageID, string spDefault, string igDefault) { diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs index 27a773c6..511c2771 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs @@ -29,16 +29,20 @@ namespace VEPROMS.CSLA.Library } public void UpdateDRoUsages(List roids) { - if (DocumentDROUsageCount > 0) + _DocumentDROUsageCount = -1; + if (DocumentDROUsages.Count > 0) { + List delList = new List(); foreach (DocumentDROUsage myUsage in DocumentDROUsages) { string roidkey = string.Format("{0}:{1}", myUsage.RODbID, myUsage.ROID); if (roids.Contains(roidkey)) roids.Remove(roidkey);// If in both, nothing to do else - myUsage.MyDROUsage.Delete(); // If only in old, remove it + delList.Add(myUsage); } + foreach (DocumentDROUsage myUsage in delList) + DocumentDROUsages.Remove(myUsage); // If only in old, remove it } foreach (string roidkey in roids) { @@ -936,6 +940,9 @@ namespace VEPROMS.CSLA.Library // Only in Word sections, convert the # to superscripts and ~ to subscrtipts tmp = Regex.Replace(tmp, "[#](.*?)[#]", "\\up2 $1\\up0 ");// DOS Superscript tmp = Regex.Replace(tmp, "[~](.*?)[~]", "\\dn2 $1\\up0 ");// DOS Subscript + tmp = tmp.Replace(@"\u160?", "\xA0"); + tmp = tmp.Replace(@"\U160?", "\xA0"); + tmp = tmp.Replace(@"[xB3]", "\xB3"); // Look for superscript or subscript and insert the appropriate commands Match roMatch = Regex.Match(tmp, @"(.*?)\\(up2|dn2) (.*?)\\(up0|dn0) "); if (roMatch.Groups.Count == 5)// Superscript or subscript found @@ -956,6 +963,10 @@ namespace VEPROMS.CSLA.Library } else // if no superscripts or subscripts just output the text { + roValue = roValue.Replace(@"\u160?", "\xA0"); + roValue = roValue.Replace(@"\U160?", "\xA0"); + roValue = roValue.Replace(@"[xB3]", "\xB3"); + roValue = roValue.Replace(@"[XB3]", "\xB3"); sel.Text = roValue; sel.Font.Color = LBWdColor.wdColorRed; } diff --git a/PROMS/Volian.Controls.Library/DisplayRO.cs b/PROMS/Volian.Controls.Library/DisplayRO.cs index 7b992efe..3ac2e79e 100644 --- a/PROMS/Volian.Controls.Library/DisplayRO.cs +++ b/PROMS/Volian.Controls.Library/DisplayRO.cs @@ -538,7 +538,8 @@ namespace Volian.Controls.Library string accPrefix = db.dbiAP.Replace(_Mydvi.DocVersionConfig.RODefaults_graphicsprefix,"IG"); accPrefix = accPrefix.Replace(_Mydvi.DocVersionConfig.RODefaults_setpointprefix, "SP"); // string accPrefix = (roch.type == 8) ? _Mydvi.DocVersionConfig.RODefaults_graphicsprefix : _Mydvi.DocVersionConfig.RODefaults_setpointprefix; - string AccPageID = string.Format("<{0}-{1}>", accPrefix, roch.appid);// makes for example + string suffix = roch.roid.Substring(12, 4) == "0041" ? "" : "." + ((char)Convert.ToInt32(roch.roid.Substring(12, 4), 16)).ToString(); + string AccPageID = string.Format("<{0}-{1}{2}>", accPrefix, roch.appid, suffix);// makes for example Console.WriteLine(AccPageID); //string AccPageID = string.Format("{0} <{1}-{2}>", ConvertSymbolsAndStuff(selectedChld.value), accPrefix, roch.appid); // value and accesory ID //string AccPageID = string.Format("{0} {1}", ConvertSymbolsAndStuff(selectedChld.value), string.Format(@"#Link:ReferencedObject: {0} {1}", roch.roid, _MyROFST.MyRODb.RODbID)); // value and link reference