protected void ObtieneAdicionales(string pXmlAdicionales) { int vIdCatalogo; XmlDocument xml = new XmlDocument(); xml.LoadXml(pXmlAdicionales); XmlNodeList departamentos = xml.GetElementsByTagName("ITEMS"); vLstAdicionales = new List <E_ADICIONALES_SELECCIONADOS>(); vLstCamposAdicionales = new List <E_CAMPOS_ADICIONALES>(); XmlNodeList lista = ((XmlElement)departamentos[0]).GetElementsByTagName("ITEM"); foreach (XmlElement nodo in lista) { E_ADICIONALES_SELECCIONADOS f = new E_ADICIONALES_SELECCIONADOS { ID_CATALOGO_LISTA = nodo.GetAttribute("ID_CATALOGO_LISTA"), CL_CAMPO = nodo.GetAttribute("CL_CAMPO"), NB_CAMPO = nodo.GetAttribute("NB_CAMPO") }; vLstAdicionales.Add(f); vIdCatalogo = int.Parse(nodo.GetAttribute("ID_CATALOGO_LISTA")); bool exist = vLstCamposAdicionales.Exists(e => e.ID_CATALOGO_LISTA == vIdCatalogo); if (!exist) { vLstCamposAdicionales.Add(new E_CAMPOS_ADICIONALES { ID_CATALOGO_LISTA = vIdCatalogo }); } } }
protected string ObtieneAdicionales(string pXmlAdicionales) { string vAdicionales = ""; XmlDocument xml = new XmlDocument(); xml.LoadXml(pXmlAdicionales); XmlNodeList departamentos = xml.GetElementsByTagName("ITEMS"); vLstAdicionales = new List <E_ADICIONALES_SELECCIONADOS>(); XmlNodeList lista = ((XmlElement)departamentos[0]).GetElementsByTagName("ITEM"); foreach (XmlElement nodo in lista) { vAdicionales = vAdicionales + nodo.GetAttribute("NB_CAMPO") + ".\n"; E_ADICIONALES_SELECCIONADOS f = new E_ADICIONALES_SELECCIONADOS { CL_CAMPO = nodo.GetAttribute("CL_CAMPO"), NB_CAMPO = nodo.GetAttribute("NB_CAMPO") }; vLstAdicionales.Add(f); } return(vAdicionales); }
protected void ObtieneValoresAdicionales(string pXmlAdicionales) { XmlDocument xml = new XmlDocument(); xml.LoadXml(pXmlAdicionales); XmlNodeList valorAdicionales = xml.GetElementsByTagName("CAMPOS"); vLstValorAdicional = new List <E_ADICIONALES_SELECCIONADOS>(); XmlNodeList lista = ((XmlElement)valorAdicionales[0]).GetElementsByTagName("CAMPO"); foreach (XmlElement nodo in lista) { E_ADICIONALES_SELECCIONADOS f = new E_ADICIONALES_SELECCIONADOS { ID_CATALOGO_LISTA = nodo.GetAttribute("ID_CAMPO"), CL_CAMPO = nodo.GetAttribute("NB_VALOR"), NB_CAMPO = nodo.GetAttribute("NB_TEXTO") }; vLstValorAdicional.Add(f); } }