diff --git a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs b/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs index cd1f0857..21c0711e 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs @@ -252,6 +252,21 @@ namespace VEPROMS.CSLA.Library s2 = s2.Replace("-", @"\u8209?"); return s2; } + private string FixUnitROs(string val) + { + if (val.StartsWith("") val = _ROFstInfo.docVer.DocVersionConfig.Unit_Text; + else if (val.ToUpper() == "") val = _ROFstInfo.docVer.DocVersionConfig.Unit_Number; + else if (val.ToUpper() == "") val = _ROFstInfo.docVer.DocVersionConfig.Unit_Name; + else if (val.ToUpper() == "") val = _ROFstInfo.docVer.DocVersionConfig.Unit_ID; + else if (val.ToUpper() == "") val = _ROFstInfo.docVer.DocVersionConfig.Other_Unit_Text; + else if (val.ToUpper() == "") val = _ROFstInfo.docVer.DocVersionConfig.Other_Unit_Number; + else if (val.ToUpper() == "") val = _ROFstInfo.docVer.DocVersionConfig.Other_Unit_Name; + else if (val.ToUpper() == "") val = _ROFstInfo.docVer.DocVersionConfig.Other_Unit_ID; + } + return val; + } // this only gets rochild values. Later we may want another // dictionary to get groups. public string GetRoValue(string ROID16) @@ -263,14 +278,14 @@ namespace VEPROMS.CSLA.Library { rochild rochld = (rochild)dicRos[ROID.ToUpper()]; if (rochld.value != null && rochld.value != string.Empty) - return rochld.value; + return FixUnitROs( rochld.value); if (rochld.children != null) { foreach (rochild child in rochld.children) - if (child.roid.ToUpper() == ROID16 || (child.roid.EndsWith("0041") && ROID16.EndsWith("0000"))) - return child.value; + if (child.roid.ToUpper() == ROID16.ToUpper() || (child.roid.EndsWith("0041") && ROID16.EndsWith("0000"))) + return FixUnitROs(child.value); // if there isn't a specific match for multi-return values, default to the first child. - return rochld.children[0].value; + return FixUnitROs(rochld.children[0].value); } } //if (ROID == "FFFF00000001") return _ROFstInfo.ROFstAssociations[0].MyDocVersion.DocVersionConfig.Unit_Number;