diff --git a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs b/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs index 0206e450..19cca666 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs @@ -14,7 +14,7 @@ namespace VEPROMS.CSLA.Library public class ROFSTLookup { #region Log4Net - private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endregion #region Structs [Serializable] @@ -95,6 +95,12 @@ namespace VEPROMS.CSLA.Library private DocVersionInfo _MyDocVersionInfo; + private ItemInfo _MyItemInfo; // B2022-020 to pass information into error log if needed + public ItemInfo MyItemInfo + { + get { return _MyItemInfo; } + set { _MyItemInfo = value; } + } public DocVersionInfo MyDocVersionInfo { get { return _MyDocVersionInfo; } @@ -118,7 +124,7 @@ namespace VEPROMS.CSLA.Library { _OtherChild = value;} } - public ROFSTLookup(ROFst rofst, DocVersionInfo dvi) + public ROFSTLookup(ROFst rofst, DocVersionInfo dvi) { _ROFst = rofst; _ROFstInfo = null; @@ -320,9 +326,9 @@ namespace VEPROMS.CSLA.Library // B2021-093 Don't look for child RO values if "roval" is null if (roval == null) return null; //string childName = MyDocVersionInfo.DocVersionConfig.Unit_Name; - MatchCollection mm = Regex.Matches(roval, "("); - if (mm.Count > 1) - Console.WriteLine("Matches {0}", mm.Count); + MatchCollection mm = Regex.Matches(roval, "("); // B2022-020 remove a un-needed question mark that was in the search criteria + if (mm.Count == 0) // B2022-020 will now write in error log if there is a problem + _MyLog.WarnFormat("Parent/Child Values not parable for \r\nItemId={0}\r\nROValue={1} ",MyDocVersionInfo.ItemID,roval); StringBuilder sb = new StringBuilder(); int lastIndex = 0; // Get selected child Idx @@ -333,7 +339,6 @@ namespace VEPROMS.CSLA.Library foreach (Match m in mm) { sb.Append(roval.Substring(lastIndex, m.Index - lastIndex)); - Console.WriteLine("Index={0},Length={1},value={2}",m.Index,m.Length,m.Value); string aplString = m.Value; string chldValStr = string.Format("UnitIdx={0} Value=", selChldIdx); int offsetIdx = aplString.IndexOf(chldValStr);//m.Value.IndexOf(chldValStr);