/// <summary> /// Añade un control a la lista a partir de la definición del valor /// </summary> public void AddControl(string strKey, ControlType intType, string strTitle, string strValue, bool blnRequired) { ControlProperty udtResult = new ControlProperty(); // Carga los datos udtResult.LoadValue(strKey, intType, strTitle, strValue, blnRequired); // Añade el control a la lista lsrValues.Add(udtResult); }
/// <summary> /// Obtiene el valor de un control /// </summary> public string GetValue(string strKey) { // Obtiene el valor if (!string.IsNullOrEmpty(strKey)) { foreach (Control ctlControl in lsrValues.ChildControls) { if (ctlControl is ControlProperty) { ControlProperty udtControl = ctlControl as ControlProperty; if (udtControl != null && udtControl.Key.Equals(strKey, StringComparison.CurrentCultureIgnoreCase)) { return(udtControl.Value); } } } } // Si ha llegado hasta aquí es porque no ha encontrado el valor return(""); }