コード例 #1
0
        //public static Dictionary<string, Dictionary<List<object>, List<object>>> GetGroupsMenuAccordingToGroup()
        //{
        //    User objUser = (User)System.Web.HttpContext.Current.Session["User"];
        //    Dictionary<string, Dictionary<List<object>, List<object>>> _ReturnDicValue = new Dictionary<string, Dictionary<List<object>, List<object>>>();
        //    Dictionary<List<object>, List<object>> dic_profilessnap = new Dictionary<List<object>, List<object>>();
        //    List<object> socialaccounts = null;
        //    List<object> accountsgroup = null;
        //    socialaccounts = new List<object>();
        //    accountsgroup = new List<object>();


        //    Api.FacebookAccount.FacebookAccount ApiobjFacebookAccount = new Api.FacebookAccount.FacebookAccount();
        //    List<FacebookAccount> lstFacebookAccount = (List<FacebookAccount>)(new JavaScriptSerializer().Deserialize(ApiobjFacebookAccount.GetAllFacebookAccountsByUserIdAndGroupId(objUser.Id.ToString(), System.Web.HttpContext.Current.Session["group"].ToString()), typeof(List<FacebookAccount>)));
        //    foreach (var FacebookAccount in lstFacebookAccount)
        //    {


        //        List<FacebookGroup> lstFacebookGroup = GetGroupName(FacebookAccount.AccessToken.ToString());

        //        if (lstFacebookGroup == null || lstFacebookGroup.Count==0)
        //        {
        //            accountsgroup.Add(null);

        //        }
        //        foreach (var FacebookGroup in lstFacebookGroup)
        //        {
        //            accountsgroup.Add(FacebookGroup);
        //        }
        //        socialaccounts.Add(FacebookAccount);
        //    }
        //    dic_profilessnap.Add(socialaccounts, accountsgroup);
        //    _ReturnDicValue.Add("facebook", dic_profilessnap);

        //    dic_profilessnap = new Dictionary<List<object>, List<object>>();
        //    socialaccounts = new List<object>();
        //    accountsgroup = new List<object>();

        //    Api.LinkedinAccount.LinkedinAccount ApiobjLinkedinAccount = new Api.LinkedinAccount.LinkedinAccount();
        //    Api.Linkedin.Linkedin ApiobjLinkedin = new Api.Linkedin.Linkedin();

        //    List<LinkedInAccount> lstLinkedinAccount = (List<LinkedInAccount>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinAccount.GetAllLinkedinAccountsByUserIdAndGroupId(objUser.Id.ToString(), System.Web.HttpContext.Current.Session["group"].ToString()), typeof(List<LinkedInAccount>)));
        //    foreach (var LinkedInAccount in lstLinkedinAccount)
        //    {
        //        //var testJsonStr= ApiobjLinkedin.GetLinkedGroupsDetail(LinkedInAccount.LinkedinUserId.ToString(), LinkedInAccount.UserId.ToString());
        //        //List<LinkedInGroup> objLinkedInGroup = Newtonsoft.Json.JsonConvert.DeserializeObject<List<LinkedInGroup>>(testJsonStr);


        //        List<LinkedInGroup.Group_Updates> objLinkedInGroup = (List<LinkedInGroup.Group_Updates>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedin.GetLinkedGroupsDetail(LinkedInAccount.LinkedinUserId.ToString(), LinkedInAccount.UserId.ToString()), typeof(List<LinkedInGroup.Group_Updates>)));
        //        //Newtonsoft.Json.Linq.JObject obj = JObject.Parse(testJsonStr);

        //        foreach (var LinkedInGroup in objLinkedInGroup)
        //        {


        //            accountsgroup.Add(LinkedInGroup);

        //        }
        //        socialaccounts.Add(LinkedInAccount);
        //    }
        //    dic_profilessnap.Add(socialaccounts, accountsgroup);
        //    _ReturnDicValue.Add("linkedin", dic_profilessnap);

        //    return _ReturnDicValue;
        //}

        public static Dictionary<string, Dictionary<object, List<object>>> GetGroupsMenuAccordingToGroup()
        {
            User objUser = (User)System.Web.HttpContext.Current.Session["User"];
            Dictionary<string, Dictionary<object, List<object>>> _ReturnDicValue = new Dictionary<string, Dictionary<object, List<object>>>();
            Dictionary<object, List<object>> dic_profilessnap = new Dictionary<object, List<object>>();
            object socialaccounts = null;

            List<object> accountsgroup = null;
            socialaccounts = new object();


            Api.FacebookAccount.FacebookAccount ApiobjFacebookAccount = new Api.FacebookAccount.FacebookAccount();
            ApiobjFacebookAccount.Timeout = 300000;
            List<FacebookAccount> lstFacebookAccount = (List<FacebookAccount>)(new JavaScriptSerializer().Deserialize(ApiobjFacebookAccount.GetAllFacebookAccountsByUserIdAndGroupId(objUser.Id.ToString(), System.Web.HttpContext.Current.Session["group"].ToString()), typeof(List<FacebookAccount>)));
            foreach (var FacebookAccount in lstFacebookAccount)
            {
                accountsgroup = new List<object>();
                List<FacebookGroup> lstFacebookGroup = GetGroupName(FacebookAccount.AccessToken.ToString());

                foreach (var FacebookGroup in lstFacebookGroup)
                {
                    accountsgroup.Add(FacebookGroup);
                }
                socialaccounts = (object)FacebookAccount;
                dic_profilessnap.Add(socialaccounts, accountsgroup);
            }
            _ReturnDicValue.Add("facebook", dic_profilessnap);

            dic_profilessnap = new Dictionary<object, List<object>>();
            socialaccounts = new object();
            accountsgroup = new List<object>();

            Api.LinkedinAccount.LinkedinAccount ApiobjLinkedinAccount = new Api.LinkedinAccount.LinkedinAccount();
            ApiobjLinkedinAccount.Timeout = 300000;
            Api.Linkedin.Linkedin ApiobjLinkedin = new Api.Linkedin.Linkedin();

            List<LinkedInAccount> lstLinkedinAccount = (List<LinkedInAccount>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinAccount.GetAllLinkedinAccountsByUserIdAndGroupId(objUser.Id.ToString(), System.Web.HttpContext.Current.Session["group"].ToString()), typeof(List<LinkedInAccount>)));
            foreach (var LinkedInAccount in lstLinkedinAccount)
            {
                accountsgroup = new List<object>();
                List<LinkedInGroup.Group_Updates> objLinkedInGroup = (List<LinkedInGroup.Group_Updates>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedin.GetLinkedGroupsDetail(LinkedInAccount.LinkedinUserId.ToString(), LinkedInAccount.UserId.ToString()), typeof(List<LinkedInGroup.Group_Updates>)));

                foreach (var LinkedInGroup in objLinkedInGroup)
                {
                    accountsgroup.Add(LinkedInGroup);
                }
                socialaccounts = (object)LinkedInAccount;
                dic_profilessnap.Add(socialaccounts, accountsgroup);
            }

            _ReturnDicValue.Add("linkedin", dic_profilessnap);

            return _ReturnDicValue;
        }
コード例 #2
0
        public static Dictionary<string, List<object>> GetFeedsMenuAccordingToGroup()
        {
            Dictionary<string, List<object>> dic_profilessnap = new Dictionary<string, List<object>>();
            try
            {
                User objUser = (User)System.Web.HttpContext.Current.Session["User"];
                Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups();
                ApiobjGroups.Timeout = 300000;
                Groups objGroups = (Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(System.Web.HttpContext.Current.Session["group"].ToString()), typeof(Groups)));
                List<object> socialaccounts = null;
                socialaccounts = new List<object>();
                Api.FacebookAccount.FacebookAccount ApiobjFacebookAccount = new Api.FacebookAccount.FacebookAccount();
                ApiobjFacebookAccount.Timeout = 300000; 
                List<FacebookAccount> lstFacebookAccount = (List<FacebookAccount>)(new JavaScriptSerializer().Deserialize(ApiobjFacebookAccount.GetAllFacebookAccountsByUserIdAndGroupId(objGroups.UserId.ToString(), System.Web.HttpContext.Current.Session["group"].ToString()), typeof(List<FacebookAccount>)));
                foreach (var FacebookAccount in lstFacebookAccount)
                {
                    socialaccounts.Add(FacebookAccount);
                }
                dic_profilessnap.Add("facebook", socialaccounts);

                socialaccounts = new List<object>();
                Api.TwitterAccount.TwitterAccount ApiobjTwitterAccount = new Api.TwitterAccount.TwitterAccount();
                ApiobjTwitterAccount.Timeout = 300000;
                List<TwitterAccount> lstTwitterAccount = (List<TwitterAccount>)(new JavaScriptSerializer().Deserialize(ApiobjTwitterAccount.GetAllTwitterAccountsByUserIdAndGroupId(objGroups.UserId.ToString(), System.Web.HttpContext.Current.Session["group"].ToString()), typeof(List<TwitterAccount>)));
                foreach (var TwitterAccount in lstTwitterAccount)
                {
                    socialaccounts.Add(TwitterAccount);
                }
                dic_profilessnap.Add("twitter", socialaccounts);

                socialaccounts = new List<object>();
                Api.LinkedinAccount.LinkedinAccount ApiobjLinkedinAccount = new Api.LinkedinAccount.LinkedinAccount();
                ApiobjLinkedinAccount.Timeout = 300000;
                List<LinkedInAccount> lstLinkedinAccount = (List<LinkedInAccount>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinAccount.GetAllLinkedinAccountsByUserIdAndGroupId(objGroups.UserId.ToString(), System.Web.HttpContext.Current.Session["group"].ToString()), typeof(List<LinkedInAccount>)));
                foreach (var LinkedInAccount in lstLinkedinAccount)
                {
                    socialaccounts.Add(LinkedInAccount);
                }
                dic_profilessnap.Add("linkedin", socialaccounts);

                socialaccounts = new List<object>();
                Api.LinkedinCompanyPage.LinkedinCompanyPage ApiobjLinkedinCompanyPage = new Api.LinkedinCompanyPage.LinkedinCompanyPage();
                ApiobjLinkedinCompanyPage.Timeout = 300000;
                List<LinkedinCompanyPage> lstLinkedinCompanyPage = (List<LinkedinCompanyPage>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinCompanyPage.GetAllLinkedinCompanyPageByUserIdAndGroupId(objUser.Id.ToString(), System.Web.HttpContext.Current.Session["group"].ToString()), typeof(List<LinkedinCompanyPage>)));
                foreach (var LiCompanyPage in lstLinkedinCompanyPage)
                {
                    socialaccounts.Add(LiCompanyPage);
                }
                dic_profilessnap.Add("linkedincompanypage", socialaccounts);


                socialaccounts = new List<object>();
                Api.InstagramAccount.InstagramAccount ApiobjInstagramAccount = new Api.InstagramAccount.InstagramAccount();
                ApiobjInstagramAccount.Timeout = 300000;
                List<InstagramAccount> lstInstagramAccount = (List<InstagramAccount>)(new JavaScriptSerializer().Deserialize(ApiobjInstagramAccount.GetAllInstagramAccountsByUserIdAndGroupId(objGroups.UserId.ToString(), System.Web.HttpContext.Current.Session["group"].ToString()), typeof(List<InstagramAccount>)));
                foreach (var InstagramAccount in lstInstagramAccount)
                {
                    socialaccounts.Add(InstagramAccount);
                }
                dic_profilessnap.Add("instagram", socialaccounts);

                socialaccounts = new List<object>();
                Api.TumblrAccount.TumblrAccount ApiobjTumblrAccount = new Api.TumblrAccount.TumblrAccount();
                ApiobjTumblrAccount.Timeout = 300000;
                List<TumblrAccount> lstTumblrAccount = (List<TumblrAccount>)(new JavaScriptSerializer().Deserialize(ApiobjTumblrAccount.GetAllTumblrAccountsByUserIdAndGroupId(objGroups.UserId.ToString(), System.Web.HttpContext.Current.Session["group"].ToString()), typeof(List<TumblrAccount>)));
                foreach (var TumblrAccount in lstTumblrAccount)
                {
                    socialaccounts.Add(TumblrAccount);
                }
                dic_profilessnap.Add("tumblr", socialaccounts);

                socialaccounts = new List<object>();
                Api.YoutubeAccount.YoutubeAccount ApiobjYoutubeAccount = new Api.YoutubeAccount.YoutubeAccount();
                ApiobjYoutubeAccount.Timeout = 300000;
                List<YoutubeAccount> lstYoutubeAccount = (List<YoutubeAccount>)(new JavaScriptSerializer().Deserialize(ApiobjYoutubeAccount.GetAllYoutubeAccountsByUserIdAndGroupId(objGroups.UserId.ToString(), System.Web.HttpContext.Current.Session["group"].ToString()), typeof(List<YoutubeAccount>)));
                foreach (var YoutubeAccount in lstYoutubeAccount)
                {
                    socialaccounts.Add(YoutubeAccount);
                }
                dic_profilessnap.Add("youtube", socialaccounts);

                socialaccounts = new List<object>();
                Api.GooglePlusAccount.GooglePlusAccount ApiobjGooglePlusAccount = new Api.GooglePlusAccount.GooglePlusAccount();
                ApiobjGooglePlusAccount.Timeout = 300000;
                List<GooglePlusAccount> lstGooglePlusAccount = (List<GooglePlusAccount>)(new JavaScriptSerializer().Deserialize(ApiobjGooglePlusAccount.GetAllBloggerAccountByUserIdAndGroupId(objGroups.UserId.ToString(), System.Web.HttpContext.Current.Session["group"].ToString()), typeof(List<GooglePlusAccount>)));
                foreach (var _GooglePlusAccount in lstGooglePlusAccount)
                {
                    socialaccounts.Add(_GooglePlusAccount);
                }
                dic_profilessnap.Add("gplus", socialaccounts);
            }
            catch (Exception ex)
            {
                logger.Error(ex.StackTrace);
                logger.Error(ex.Message);
            }
            return dic_profilessnap;
        }
コード例 #3
0
        public static Dictionary <string, Dictionary <List <object>, List <object> > > GetGroupsMenuAccordingToGroup()
        {
            User objUser = (User)System.Web.HttpContext.Current.Session["User"];
            Dictionary <string, Dictionary <List <object>, List <object> > > _ReturnDicValue = new Dictionary <string, Dictionary <List <object>, List <object> > >();
            Dictionary <List <object>, List <object> > dic_profilessnap = new Dictionary <List <object>, List <object> >();
            List <object> socialaccounts = null;
            List <object> accountsgroup  = null;

            socialaccounts = new List <object>();
            accountsgroup  = new List <object>();

            Api.FacebookAccount.FacebookAccount ApiobjFacebookAccount = new Api.FacebookAccount.FacebookAccount();
            List <FacebookAccount> lstFacebookAccount = (List <FacebookAccount>)(new JavaScriptSerializer().Deserialize(ApiobjFacebookAccount.GetAllFacebookAccountsByUserIdAndGroupId(objUser.Id.ToString(), System.Web.HttpContext.Current.Session["group"].ToString()), typeof(List <FacebookAccount>)));

            foreach (var FacebookAccount in lstFacebookAccount)
            {
                List <FacebookGroup> lstFacebookGroup = GetGroupName(FacebookAccount.AccessToken.ToString());
                foreach (var FacebookGroup in lstFacebookGroup)
                {
                    accountsgroup.Add(FacebookGroup);
                }
                socialaccounts.Add(FacebookAccount);
            }
            dic_profilessnap.Add(socialaccounts, accountsgroup);
            _ReturnDicValue.Add("facebook", dic_profilessnap);

            dic_profilessnap = new Dictionary <List <object>, List <object> >();
            socialaccounts   = new List <object>();
            accountsgroup    = new List <object>();

            Api.LinkedinAccount.LinkedinAccount ApiobjLinkedinAccount = new Api.LinkedinAccount.LinkedinAccount();
            Api.Linkedin.Linkedin ApiobjLinkedin = new Api.Linkedin.Linkedin();

            List <LinkedInAccount> lstLinkedinAccount = (List <LinkedInAccount>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinAccount.GetAllLinkedinAccountsByUserIdAndGroupId(objUser.Id.ToString(), System.Web.HttpContext.Current.Session["group"].ToString()), typeof(List <LinkedInAccount>)));

            foreach (var LinkedInAccount in lstLinkedinAccount)
            {
                //var testJsonStr= ApiobjLinkedin.GetLinkedGroupsDetail(LinkedInAccount.LinkedinUserId.ToString(), LinkedInAccount.UserId.ToString());
                //List<LinkedInGroup> objLinkedInGroup = Newtonsoft.Json.JsonConvert.DeserializeObject<List<LinkedInGroup>>(testJsonStr);


                List <LinkedInGroup.Group_Updates> objLinkedInGroup = (List <LinkedInGroup.Group_Updates>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedin.GetLinkedGroupsDetail(LinkedInAccount.LinkedinUserId.ToString(), LinkedInAccount.UserId.ToString()), typeof(List <LinkedInGroup.Group_Updates>)));
                //Newtonsoft.Json.Linq.JObject obj = JObject.Parse(testJsonStr);

                foreach (var LinkedInGroup in objLinkedInGroup)
                {
                    accountsgroup.Add(LinkedInGroup);
                }
                socialaccounts.Add(LinkedInAccount);
            }
            dic_profilessnap.Add(socialaccounts, accountsgroup);
            _ReturnDicValue.Add("linkedin", dic_profilessnap);

            return(_ReturnDicValue);
        }
コード例 #4
0
        public static Dictionary <string, List <object> > GetFeedsMenuAccordingToGroup()
        {
            User objUser = (User)System.Web.HttpContext.Current.Session["User"];
            Dictionary <string, List <object> > dic_profilessnap = new Dictionary <string, List <object> >();

            List <object> socialaccounts = null;

            socialaccounts = new List <object>();
            Api.FacebookAccount.FacebookAccount ApiobjFacebookAccount = new Api.FacebookAccount.FacebookAccount();
            List <FacebookAccount> lstFacebookAccount = (List <FacebookAccount>)(new JavaScriptSerializer().Deserialize(ApiobjFacebookAccount.GetAllFacebookAccountsByUserIdAndGroupId(objUser.Id.ToString(), System.Web.HttpContext.Current.Session["group"].ToString()), typeof(List <FacebookAccount>)));

            foreach (var FacebookAccount in lstFacebookAccount)
            {
                socialaccounts.Add(FacebookAccount);
            }
            dic_profilessnap.Add("facebook", socialaccounts);

            socialaccounts = new List <object>();
            Api.TwitterAccount.TwitterAccount ApiobjTwitterAccount = new Api.TwitterAccount.TwitterAccount();
            List <TwitterAccount>             lstTwitterAccount    = (List <TwitterAccount>)(new JavaScriptSerializer().Deserialize(ApiobjTwitterAccount.GetAllTwitterAccountsByUserIdAndGroupId(objUser.Id.ToString(), System.Web.HttpContext.Current.Session["group"].ToString()), typeof(List <TwitterAccount>)));

            foreach (var TwitterAccount in lstTwitterAccount)
            {
                socialaccounts.Add(TwitterAccount);
            }
            dic_profilessnap.Add("twitter", socialaccounts);

            socialaccounts = new List <object>();
            Api.LinkedinAccount.LinkedinAccount ApiobjLinkedinAccount = new Api.LinkedinAccount.LinkedinAccount();
            List <LinkedInAccount> lstLinkedinAccount = (List <LinkedInAccount>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinAccount.GetAllLinkedinAccountsByUserIdAndGroupId(objUser.Id.ToString(), System.Web.HttpContext.Current.Session["group"].ToString()), typeof(List <LinkedInAccount>)));

            foreach (var LinkedInAccount in lstLinkedinAccount)
            {
                socialaccounts.Add(LinkedInAccount);
            }
            dic_profilessnap.Add("linkedin", socialaccounts);

            socialaccounts = new List <object>();
            Api.InstagramAccount.InstagramAccount ApiobjInstagramAccount = new Api.InstagramAccount.InstagramAccount();
            List <InstagramAccount> lstInstagramAccount = (List <InstagramAccount>)(new JavaScriptSerializer().Deserialize(ApiobjInstagramAccount.GetAllInstagramAccountsByUserIdAndGroupId(objUser.Id.ToString(), System.Web.HttpContext.Current.Session["group"].ToString()), typeof(List <InstagramAccount>)));

            foreach (var InstagramAccount in lstInstagramAccount)
            {
                socialaccounts.Add(InstagramAccount);
            }
            dic_profilessnap.Add("instagram", socialaccounts);

            socialaccounts = new List <object>();
            Api.TumblrAccount.TumblrAccount ApiobjTumblrAccount = new Api.TumblrAccount.TumblrAccount();
            List <TumblrAccount>            lstTumblrAccount    = (List <TumblrAccount>)(new JavaScriptSerializer().Deserialize(ApiobjTumblrAccount.GetAllTumblrAccountsByUserIdAndGroupId(objUser.Id.ToString(), System.Web.HttpContext.Current.Session["group"].ToString()), typeof(List <TumblrAccount>)));

            foreach (var TumblrAccount in lstTumblrAccount)
            {
                socialaccounts.Add(TumblrAccount);
            }
            dic_profilessnap.Add("tumblr", socialaccounts);

            socialaccounts = new List <object>();
            Api.YoutubeAccount.YoutubeAccount ApiobjYoutubeAccount = new Api.YoutubeAccount.YoutubeAccount();
            List <YoutubeAccount>             lstYoutubeAccount    = (List <YoutubeAccount>)(new JavaScriptSerializer().Deserialize(ApiobjYoutubeAccount.GetAllYoutubeAccountsByUserIdAndGroupId(objUser.Id.ToString(), System.Web.HttpContext.Current.Session["group"].ToString()), typeof(List <YoutubeAccount>)));

            foreach (var YoutubeAccount in lstYoutubeAccount)
            {
                socialaccounts.Add(YoutubeAccount);
            }
            dic_profilessnap.Add("youtube", socialaccounts);



            return(dic_profilessnap);
        }
コード例 #5
0
ファイル: SBUtils.cs プロジェクト: prog-moh/socioboard-core
        public static Dictionary<string, Dictionary<List<object>, List<object>>> GetGroupsMenuAccordingToGroup()
        {
            User objUser = (User)System.Web.HttpContext.Current.Session["User"];
            Dictionary<string, Dictionary<List<object>, List<object>>> _ReturnDicValue = new Dictionary<string, Dictionary<List<object>, List<object>>>();
            Dictionary<List<object>, List<object>> dic_profilessnap = new Dictionary<List<object>, List<object>>();
            List<object> socialaccounts = null;
            List<object> accountsgroup = null;

            socialaccounts = new List<object>();
            accountsgroup = new List<object>();

            Api.FacebookAccount.FacebookAccount ApiobjFacebookAccount = new Api.FacebookAccount.FacebookAccount();
            List<FacebookAccount> lstFacebookAccount = (List<FacebookAccount>)(new JavaScriptSerializer().Deserialize(ApiobjFacebookAccount.GetAllFacebookAccountsByUserIdAndGroupId(objUser.Id.ToString(), System.Web.HttpContext.Current.Session["group"].ToString()), typeof(List<FacebookAccount>)));
            foreach (var FacebookAccount in lstFacebookAccount)
            {

                List<FacebookGroup> lstFacebookGroup = GetGroupName(FacebookAccount.AccessToken.ToString());
                foreach (var FacebookGroup in lstFacebookGroup)
                {
                    accountsgroup.Add(FacebookGroup);
                }
                socialaccounts.Add(FacebookAccount);
            }
            dic_profilessnap.Add(socialaccounts, accountsgroup);
            _ReturnDicValue.Add("facebook", dic_profilessnap);

            dic_profilessnap = new Dictionary<List<object>, List<object>>();
            socialaccounts = new List<object>();
            accountsgroup = new List<object>();

            Api.LinkedinAccount.LinkedinAccount ApiobjLinkedinAccount = new Api.LinkedinAccount.LinkedinAccount();
            Api.Linkedin.Linkedin ApiobjLinkedin = new Api.Linkedin.Linkedin();

            List<LinkedInAccount> lstLinkedinAccount = (List<LinkedInAccount>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinAccount.GetAllLinkedinAccountsByUserIdAndGroupId(objUser.Id.ToString(), System.Web.HttpContext.Current.Session["group"].ToString()), typeof(List<LinkedInAccount>)));
            foreach (var LinkedInAccount in lstLinkedinAccount)
            {
                //var testJsonStr= ApiobjLinkedin.GetLinkedGroupsDetail(LinkedInAccount.LinkedinUserId.ToString(), LinkedInAccount.UserId.ToString());
                //List<LinkedInGroup> objLinkedInGroup = Newtonsoft.Json.JsonConvert.DeserializeObject<List<LinkedInGroup>>(testJsonStr);


                List<LinkedInGroup.Group_Updates> objLinkedInGroup = (List<LinkedInGroup.Group_Updates>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedin.GetLinkedGroupsDetail(LinkedInAccount.LinkedinUserId.ToString(), LinkedInAccount.UserId.ToString()), typeof(List<LinkedInGroup.Group_Updates>)));
                //Newtonsoft.Json.Linq.JObject obj = JObject.Parse(testJsonStr);

                foreach (var LinkedInGroup in objLinkedInGroup)
                {
                   

                    accountsgroup.Add(LinkedInGroup);
                    
                }
                 socialaccounts.Add(LinkedInAccount);
            }
            dic_profilessnap.Add(socialaccounts, accountsgroup);
            _ReturnDicValue.Add("linkedin", dic_profilessnap);

            return _ReturnDicValue;
        }
コード例 #6
0
ファイル: SBUtils.cs プロジェクト: prog-moh/socioboard-core
        public static Dictionary<string, List<object>> GetFeedsMenuAccordingToGroup()
        {
            User objUser = (User)System.Web.HttpContext.Current.Session["User"];
            Dictionary<string, List<object>> dic_profilessnap = new Dictionary<string, List<object>>();
               
            List<object> socialaccounts = null;
                
                    socialaccounts = new List<object>();
                    Api.FacebookAccount.FacebookAccount ApiobjFacebookAccount = new Api.FacebookAccount.FacebookAccount();
                    List<FacebookAccount> lstFacebookAccount = (List<FacebookAccount>)(new JavaScriptSerializer().Deserialize(ApiobjFacebookAccount.GetAllFacebookAccountsByUserIdAndGroupId(objUser.Id.ToString(), System.Web.HttpContext.Current.Session["group"].ToString()), typeof(List<FacebookAccount>)));
                    foreach (var FacebookAccount in lstFacebookAccount)
                    {
                        socialaccounts.Add(FacebookAccount);
                    }
                    dic_profilessnap.Add("facebook", socialaccounts);
               
                    socialaccounts = new List<object>();
                    Api.TwitterAccount.TwitterAccount ApiobjTwitterAccount = new Api.TwitterAccount.TwitterAccount();
                    List<TwitterAccount> lstTwitterAccount = (List<TwitterAccount>)(new JavaScriptSerializer().Deserialize(ApiobjTwitterAccount.GetAllTwitterAccountsByUserIdAndGroupId(objUser.Id.ToString(), System.Web.HttpContext.Current.Session["group"].ToString()), typeof(List<TwitterAccount>)));
                    foreach (var TwitterAccount in lstTwitterAccount)
                    {
                        socialaccounts.Add(TwitterAccount);
                    }
                    dic_profilessnap.Add("twitter", socialaccounts);
               
                    socialaccounts = new List<object>();
                    Api.LinkedinAccount.LinkedinAccount ApiobjLinkedinAccount = new Api.LinkedinAccount.LinkedinAccount();
                    List<LinkedInAccount> lstLinkedinAccount = (List<LinkedInAccount>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinAccount.GetAllLinkedinAccountsByUserIdAndGroupId(objUser.Id.ToString(), System.Web.HttpContext.Current.Session["group"].ToString()), typeof(List<LinkedInAccount>)));
                    foreach (var LinkedInAccount in lstLinkedinAccount)
                    {
                        socialaccounts.Add(LinkedInAccount);
                    }
                    dic_profilessnap.Add("linkedin", socialaccounts);
                
                    socialaccounts = new List<object>();
                    Api.InstagramAccount.InstagramAccount ApiobjInstagramAccount = new Api.InstagramAccount.InstagramAccount();
                    List<InstagramAccount> lstInstagramAccount = (List<InstagramAccount>)(new JavaScriptSerializer().Deserialize(ApiobjInstagramAccount.GetAllInstagramAccountsByUserIdAndGroupId(objUser.Id.ToString(), System.Web.HttpContext.Current.Session["group"].ToString()), typeof(List<InstagramAccount>)));
                    foreach (var InstagramAccount in lstInstagramAccount)
                    {
                        socialaccounts.Add(InstagramAccount);
                    }
                    dic_profilessnap.Add("instagram", socialaccounts);
                
                    socialaccounts = new List<object>();
                    Api.TumblrAccount.TumblrAccount ApiobjTumblrAccount = new Api.TumblrAccount.TumblrAccount();
                    List<TumblrAccount> lstTumblrAccount = (List<TumblrAccount>)(new JavaScriptSerializer().Deserialize(ApiobjTumblrAccount.GetAllTumblrAccountsByUserIdAndGroupId(objUser.Id.ToString(), System.Web.HttpContext.Current.Session["group"].ToString()), typeof(List<TumblrAccount>)));
                    foreach (var TumblrAccount in lstTumblrAccount)
                    {
                        socialaccounts.Add(TumblrAccount);
                    }
                    dic_profilessnap.Add("tumblr", socialaccounts);
             
                    socialaccounts = new List<object>();
                    Api.YoutubeAccount.YoutubeAccount ApiobjYoutubeAccount = new Api.YoutubeAccount.YoutubeAccount();
                    List<YoutubeAccount> lstYoutubeAccount = (List<YoutubeAccount>)(new JavaScriptSerializer().Deserialize(ApiobjYoutubeAccount.GetAllYoutubeAccountsByUserIdAndGroupId(objUser.Id.ToString(), System.Web.HttpContext.Current.Session["group"].ToString()), typeof(List<YoutubeAccount>)));
                    foreach (var YoutubeAccount in lstYoutubeAccount)
                    {
                        socialaccounts.Add(YoutubeAccount);
                    }
                    dic_profilessnap.Add("youtube", socialaccounts);
                

            
            return dic_profilessnap;
        }