public string GetLinkedinCompanyPage(string oauth_token, string oauth_verifier, string reuqestTokenSecret, string consumerKey, string consumerSecret, string UserId, string GroupId)
        {
            List<Helper.AddlinkedinCompanyPage> lstAddLinkedinPage = new List<Helper.AddlinkedinCompanyPage>();
            string ret = string.Empty;
            oAuthLinkedIn _oauth = new oAuthLinkedIn();
            try
            {
                _oauth.ConsumerKey = consumerKey;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            try
            {
                _oauth.ConsumerSecret = consumerSecret;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            try
            {
                _oauth.Token = oauth_token;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            try
            {
                _oauth.TokenSecret = reuqestTokenSecret;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);

            }
            try
            {
                _oauth.Verifier = oauth_verifier;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            try
            {
                _oauth.AccessTokenGet(oauth_token);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);

            }

            XmlDocument xmlResult = new XmlDocument();
            XmlDocument xmlCompany = new XmlDocument();
            GlobusLinkedinLib.LinkedIn.Core.PeopleMethods.People peopleConnection = new GlobusLinkedinLib.LinkedIn.Core.PeopleMethods.People();
            xmlResult = peopleConnection.Get_UserProfile(_oauth);
            string UserProfileId = xmlResult.GetElementsByTagName("id")[0].InnerText;
            string response = _oauth.APIWebRequest("GET", GlobusLinkedinLib.App.Core.Global.GetCompanyUrl, null);

            string strLidPageDiv = string.Empty;
            xmlCompany.Load(new StringReader(response));

            string cnt = string.Empty;
            XmlElement root = xmlCompany.DocumentElement;
            if (root.HasAttribute("total"))
            {
                cnt = root.GetAttribute("total");
            }
            int total = Convert.ToInt16(cnt);
            if (total != 0)
            {
                for (int i = 0; i < total; i++)
                {
                    Helper.AddlinkedinCompanyPage objAddLinkedinPage = new Helper.AddlinkedinCompanyPage();
                    objAddLinkedinPage.PageId = xmlCompany.GetElementsByTagName("id")[i].InnerText;
                    objAddLinkedinPage.PageName = xmlCompany.GetElementsByTagName("name")[i].InnerText;
                    objAddLinkedinPage._Oauth = _oauth;

                    lstAddLinkedinPage.Add(objAddLinkedinPage);
                }
            }

            return new JavaScriptSerializer().Serialize(lstAddLinkedinPage);
        }
        public string GetLinkedinCompanyPage(string oauth_token, string oauth_verifier, string reuqestTokenSecret, string consumerKey, string consumerSecret, string UserId, string GroupId)
        {
            List <Helper.AddlinkedinCompanyPage> lstAddLinkedinPage = new List <Helper.AddlinkedinCompanyPage>();
            string        ret    = string.Empty;
            oAuthLinkedIn _oauth = new oAuthLinkedIn();

            try
            {
                _oauth.ConsumerKey = consumerKey;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            try
            {
                _oauth.ConsumerSecret = consumerSecret;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            try
            {
                _oauth.Token = oauth_token;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            try
            {
                _oauth.TokenSecret = reuqestTokenSecret;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            try
            {
                _oauth.Verifier = oauth_verifier;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            try
            {
                _oauth.AccessTokenGet(oauth_token);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

            XmlDocument xmlResult  = new XmlDocument();
            XmlDocument xmlCompany = new XmlDocument();

            GlobusLinkedinLib.LinkedIn.Core.PeopleMethods.People peopleConnection = new GlobusLinkedinLib.LinkedIn.Core.PeopleMethods.People();
            xmlResult = peopleConnection.Get_UserProfile(_oauth);
            string UserProfileId = xmlResult.GetElementsByTagName("id")[0].InnerText;
            string response      = _oauth.APIWebRequest("GET", GlobusLinkedinLib.App.Core.Global.GetCompanyUrl, null);

            string strLidPageDiv = string.Empty;

            xmlCompany.Load(new StringReader(response));

            string     cnt  = string.Empty;
            XmlElement root = xmlCompany.DocumentElement;

            if (root.HasAttribute("total"))
            {
                cnt = root.GetAttribute("total");
            }
            int total = Convert.ToInt16(cnt);

            if (total != 0)
            {
                for (int i = 0; i < total; i++)
                {
                    Helper.AddlinkedinCompanyPage objAddLinkedinPage = new Helper.AddlinkedinCompanyPage();
                    objAddLinkedinPage.PageId   = xmlCompany.GetElementsByTagName("id")[i].InnerText;
                    objAddLinkedinPage.PageName = xmlCompany.GetElementsByTagName("name")[i].InnerText;
                    objAddLinkedinPage._Oauth   = _oauth;

                    lstAddLinkedinPage.Add(objAddLinkedinPage);
                }
            }

            return(new JavaScriptSerializer().Serialize(lstAddLinkedinPage));
        }