ServiceProviderGetByID() public method

public ServiceProviderGetByID ( long AtulServiceProviderID ) : DataTable
AtulServiceProviderID long
return System.Data.DataTable
示例#1
0
        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;
        }