/// <summary> /// get the Flexfield. /// </summary> /// <returns></returns> public string FlexFieldGet() { DataTable returnTable = new DataTable(); Atul_v1Data adb = new Atul_v1Data(); returnTable = adb.FlexFieldGet(); return JsonMethods.GetJSONString(returnTable); }
public string GetProviderParameters(long providerId, string ProviderVerb) { //get the provider XML DataTable returnTable = new DataTable(); DataTable flexfields = new DataTable(); Atul_v1Data adb = new Atul_v1Data(); returnTable = adb.ServiceProviderGetByID(providerId); flexfields = adb.FlexFieldGet(); string ProviderXML = returnTable.Rows[0]["ServiceProviderXML"].ToString(); string ProviderName = returnTable.Rows[0]["ServiceProviderName"].ToString(); string JSON = string.Empty; XmlDocument pxml = new XmlDocument(); pxml.LoadXml(ProviderXML); XmlNodeList parameters = pxml.SelectNodes("//verb[name='"+ProviderVerb+"']/parameter"); XmlDocument xdoc = new XmlDocument(); xdoc.LoadXml(@"<parameters></parameters>"); foreach (XmlNode p in parameters) { XmlElement e = xdoc.CreateElement("parameter"); e.InnerText = p.InnerText; xdoc.AppendChild(e); } JSON = JsonMethods.XmlToJSON(xdoc); return JSON; }