/// <summary> /// Returns the IshLovValue identified by LovId and LovValueId /// </summary> /// <param name="lovId">List of Value identifier like 'DRESOLUTION'</param> /// <param name="lovValueId">List of Value Value identifier, aka IshRef, like 'VRESHIGH'</param> /// <param name="ishLovValue">The complete initialized object including label and active flag</param> /// <returns></returns> public bool TryGetIshLovValue(string lovId, string lovValueId, out IshLovValue ishLovValue) { if (_lovValues.TryGetValue(lovId + keySeparator + lovValueId, out ishLovValue)) { return(true); } return(false); }
/// <summary> /// Creates a new instance of the <see cref="IshLovValues"/> class. /// </summary> /// <param name="xmlIshLovValues">The xml containing the LovValues.</param> public IshLovValues(string xmlIshLovValues) { XmlDocument xmlDocument = new XmlDocument(); xmlDocument.LoadXml(xmlIshLovValues); _lovValues = new Dictionary <string, IshLovValue>(); foreach (XmlNode ishLov in xmlDocument.SelectNodes("ishlovs/ishlov")) { string lovId = ishLov.Attributes["ishref"].Value; foreach (XmlNode xmlIshLovValue in ishLov.SelectNodes("./ishlovvalues/ishlovvalue")) { var ishLovValue = new IshLovValue(lovId, (XmlElement)xmlIshLovValue); _lovValues.Add((lovId + keySeparator + ishLovValue.IshRef), ishLovValue); } } }