From 36bf0cda84e1705696a370ecfd6d987ff553fc2e Mon Sep 17 00:00:00 2001 From: Rich Date: Mon, 25 Nov 2013 12:36:19 +0000 Subject: [PATCH] Multiple return values were check uppercase ROID against a mixed case ROID and returning the wrong selection. If the return value from rolookup is a Unit RO, convert it to it's value. --- .../Config/ROFSTLookup.cs | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) 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;