Example #1
0
        public ActionResult AuthenticateWordpress()
        {
            string wordpressredirecturl = string.Empty;

            try
            {
                Api.Groups.Groups objApiGroups = new Api.Groups.Groups();
                JObject           group        = JObject.Parse(objApiGroups.GetGroupDetailsByGroupId(Session["group"].ToString().ToString()));
                wordpressredirecturl = SBUtils.GetWordpressRedirectLink();
                Response.Redirect(wordpressredirecturl);
                //int profilecount = (Int16)(Session["ProfileCount"]);
                //int totalaccount = (Int16)Session["TotalAccount"];
                //if (Convert.ToString(group["GroupName"]) == "Socioboard")
                //{
                //    if (profilecount < totalaccount)
                //    {
                //        wordpressredirecturl = SBUtils.GetWordpressRedirectLink();
                //        Response.Redirect(wordpressredirecturl);
                //    }
                //    else
                //    {
                //        return RedirectToAction("Index", "Home");
                //    }
                //}
            }
            catch (Exception ex)
            {
                return(RedirectToAction("Index", "Home"));
            }
            return(Content(wordpressredirecturl));
        }
Example #2
0
 public ActionResult AuthenticateLinkedin()
 {
     try
     {
         try
         {
             Api.Groups.Groups objApiGroups = new Api.Groups.Groups();
             JObject           group        = JObject.Parse(objApiGroups.GetGroupDetailsByGroupId(Session["group"].ToString().ToString()));
             int profilecount = (Int16)(Session["ProfileCount"]);
             int totalaccount = (Int16)Session["TotalAccount"];
             if (Convert.ToString(group["GroupName"]) == "Socioboard")
             {
                 if (profilecount < totalaccount)
                 {
                     Api.Linkedin.Linkedin objApiLinkedin = new Api.Linkedin.Linkedin();
                     string redircturl = objApiLinkedin.GetLinkedinRedirectUrl(ConfigurationManager.AppSettings["LiApiKey"], ConfigurationManager.AppSettings["LiSecretKey"]);
                     Session["reuqestToken"]       = redircturl.Split('~')[1].ToString();
                     Session["reuqestTokenSecret"] = redircturl.Split('~')[2].ToString();
                     redircturl = redircturl.Split('~')[0].ToString();
                     Response.Redirect(redircturl);
                 }
                 else
                 {
                 }
             }
         }
         catch (Exception ex)
         {
         }
     }
     catch (Exception ex)
     {
     }
     return(View());
 }
Example #3
0
        public ActionResult scheduler(string network, string profileid)
        {
            Dictionary <object, List <ScheduledMessage> > dictscheduler = new Dictionary <object, List <ScheduledMessage> >();

            Api.Groups.Groups ApiobjGroups            = new Api.Groups.Groups();
            Domain.Socioboard.Domain.Groups objGroups = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
            if (network == "facebook")
            {
                Api.FacebookAccount.FacebookAccount ApiobjFacebookAccount = new Api.FacebookAccount.FacebookAccount();
                FacebookAccount objFacebookAccount = (FacebookAccount)(new JavaScriptSerializer().Deserialize(ApiobjFacebookAccount.getFacebookAccountDetailsById(objGroups.UserId.ToString(), profileid.ToString()), typeof(FacebookAccount)));
                Api.ScheduledMessage.ScheduledMessage ApiobjScheduledMessage = new Api.ScheduledMessage.ScheduledMessage();
                List <ScheduledMessage> objScheduledMessage = (List <ScheduledMessage>)(new JavaScriptSerializer().Deserialize(ApiobjScheduledMessage.GetAllUnSentMessagesAccordingToGroup(objGroups.UserId.ToString(), profileid.ToString(), network), typeof(List <ScheduledMessage>)));
                dictscheduler.Add(objFacebookAccount, objScheduledMessage);
            }
            else if (network == "twitter")
            {
                Api.TwitterAccount.TwitterAccount ApiobjTwitterAccount = new Api.TwitterAccount.TwitterAccount();
                TwitterAccount objTwitterAccount = (TwitterAccount)(new JavaScriptSerializer().Deserialize(ApiobjTwitterAccount.GetTwitterAccountDetailsById(objGroups.UserId.ToString(), profileid.ToString()), typeof(TwitterAccount)));
                Api.ScheduledMessage.ScheduledMessage ApiobjScheduledMessage = new Api.ScheduledMessage.ScheduledMessage();
                List <ScheduledMessage> objScheduledMessage = (List <ScheduledMessage>)(new JavaScriptSerializer().Deserialize(ApiobjScheduledMessage.GetAllUnSentMessagesAccordingToGroup(objGroups.UserId.ToString(), profileid.ToString(), network), typeof(List <ScheduledMessage>)));
                dictscheduler.Add(objTwitterAccount, objScheduledMessage);
            }
            else if (network == "linkedin")
            {
                Api.LinkedinAccount.LinkedinAccount ApiobjLinkedinAccount = new Api.LinkedinAccount.LinkedinAccount();
                LinkedInAccount objLinkedInAccount = (LinkedInAccount)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinAccount.GetLinkedinAccountDetailsById(objGroups.UserId.ToString(), profileid.ToString()), typeof(LinkedInAccount)));
                Api.ScheduledMessage.ScheduledMessage ApiobjScheduledMessage = new Api.ScheduledMessage.ScheduledMessage();
                List <ScheduledMessage> objScheduledMessage = (List <ScheduledMessage>)(new JavaScriptSerializer().Deserialize(ApiobjScheduledMessage.GetAllUnSentMessagesAccordingToGroup(objGroups.UserId.ToString(), profileid.ToString(), network), typeof(List <ScheduledMessage>)));
                dictscheduler.Add(objLinkedInAccount, objScheduledMessage);
            }

            return(PartialView("_Panel3Partial", dictscheduler));
        }
Example #4
0
 public ActionResult wallposts(string op, string load, string profileid)
 {
     Dictionary<string, List<object>> dictwallposts = new Dictionary<string, List<object>>();
     if (load == "first")
     {
         Session["FacebookProfileIdForFeeds"] = profileid;
         facebookwallcount = 0;
     }
     else
     {
         profileid = (string)Session["FacebookProfileIdForFeeds"];
         facebookwallcount = facebookwallcount + 10;
     }
     Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups();
     Domain.Socioboard.Domain.Groups objGroups = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
     Api.FacebookMessage.FacebookMessage ApiobjFacebookMessage = new Api.FacebookMessage.FacebookMessage();
     List<Domain.Socioboard.Domain.FacebookMessage> lstFacebookMessage = (List<Domain.Socioboard.Domain.FacebookMessage>)(new JavaScriptSerializer().Deserialize(ApiobjFacebookMessage.GetAllWallpostsOfProfileAccordingtoGroup(profileid, facebookwallcount, objGroups.UserId.ToString()), typeof(List<Domain.Socioboard.Domain.FacebookMessage>)));
     List<object> lstobject = new List<object>();
     foreach (var item in lstFacebookMessage)
     {
         lstobject.Add(item);
     }
     dictwallposts.Add("facebook", lstobject);
     return PartialView("_Panel1Partial", dictwallposts);
 }
 public ActionResult AuthenticateTumblr()
 {
     try
     {
         try
         {
             Api.Groups.Groups objApiGroups = new Api.Groups.Groups();
             JObject           group        = JObject.Parse(objApiGroups.GetGroupDetailsByGroupId(Session["group"].ToString().ToString()));
             int profilecount = (Int16)(Session["ProfileCount"]);
             int totalaccount = (Int16)Session["TotalAccount"];
             if (Convert.ToString(group["GroupName"]) == "Socioboard")
             {
                 if (profilecount < totalaccount)
                 {
                     Api.Tumblr.Tumblr ApiobjTumblr = new Api.Tumblr.Tumblr();
                     string            redircturl   = ApiobjTumblr.GetTumblrRedirectUrl(ConfigurationManager.AppSettings["TumblrClientKey"], ConfigurationManager.AppSettings["TumblrClientSec"], ConfigurationManager.AppSettings["TumblrCallBackURL"]);
                     Response.Redirect(redircturl);
                 }
                 else
                 {
                 }
             }
         }
         catch (Exception ex)
         {
         }
     }
     catch (Exception ex)
     {
     }
     return(View());
 }
 public ActionResult AuthenticateWordpress()
 {
     string wordpressredirecturl = string.Empty;
     try
     {
         Api.Groups.Groups objApiGroups = new Api.Groups.Groups();
         JObject group = JObject.Parse(objApiGroups.GetGroupDetailsByGroupId(Session["group"].ToString().ToString()));
         wordpressredirecturl = SBUtils.GetWordpressRedirectLink();
         Response.Redirect(wordpressredirecturl);
         //int profilecount = (Int16)(Session["ProfileCount"]);
         //int totalaccount = (Int16)Session["TotalAccount"];
         //if (Convert.ToString(group["GroupName"]) == "Socioboard")
         //{
         //    if (profilecount < totalaccount)
         //    {
         //        wordpressredirecturl = SBUtils.GetWordpressRedirectLink();
         //        Response.Redirect(wordpressredirecturl);
         //    }
         //    else
         //    {
         //        return RedirectToAction("Index", "Home");
         //    }
         //}
     }
     catch (Exception ex)
     {
         return RedirectToAction("Index", "Home");
     }
     return Content(wordpressredirecturl);
 }
Example #7
0
 public ActionResult AuthenticateTwitter()
 {
     try
     {
         try
         {
             Api.Groups.Groups objApiGroups = new Api.Groups.Groups();
             JObject           group        = JObject.Parse(objApiGroups.GetGroupDetailsByGroupId(Session["group"].ToString().ToString()));
             int profilecount = (Int16)(Session["ProfileCount"]);
             int totalaccount = (Int16)Session["TotalAccount"];
             if (Convert.ToString(group["GroupName"]) == "Socioboard")
             {
                 if (profilecount < totalaccount)
                 {
                     Api.Twitter.Twitter apiobjTwitter = new Api.Twitter.Twitter();
                     string TwitterUrl = apiobjTwitter.GetTwitterRedirectUrl(ConfigurationManager.AppSettings["consumerKey"], ConfigurationManager.AppSettings["consumerSecret"], ConfigurationManager.AppSettings["callbackurl"]);
                     string str        = TwitterUrl.Split('~')[0].ToString();
                     Session["requestSecret"] = TwitterUrl.Split('~')[1].ToString();
                     Response.Redirect(TwitterUrl.Split('~')[0].ToString());
                 }
                 else
                 {
                 }
             }
         }
         catch (Exception ex)
         {
         }
     }
     catch (Exception ex)
     {
     }
     return(View());
 }
Example #8
0
        // Commented By Antima

        //public ActionResult linkedinwallposts(string profileid)
        //{
        //    Dictionary<string, List<object>> dictwallposts = new Dictionary<string, List<object>>();
        //    Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups();
        //    Domain.Socioboard.Domain.Groups objGroups = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
        //    Api.LinkedInFeed.LinkedInFeed ApiobjLinkedInFeed = new Api.LinkedInFeed.LinkedInFeed();
        //    List<Domain.Socioboard.Domain.LinkedInFeed> lstLinkedInFeed = (List<Domain.Socioboard.Domain.LinkedInFeed>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedInFeed.GetLinkedInFeeds(objGroups.UserId.ToString(), profileid), typeof(List<Domain.Socioboard.Domain.LinkedInFeed>)));
        //    List<object> lstobject = new List<object>();
        //    foreach (var item in lstLinkedInFeed)
        //    {
        //        lstobject.Add(item);
        //    }
        //    dictwallposts.Add("linkedin", lstobject);
        //    return PartialView("_Panel1Partial", dictwallposts);
        //}

        public ActionResult linkedinwallposts(string profileid, string load)
        {
            Dictionary <string, List <object> > dictwallposts = new Dictionary <string, List <object> >();

            if (load == "first")
            {
                Session["LinkedInProfileIdForFeeds"] = profileid;
                linkedinwallcount = 0;
            }
            else
            {
                profileid         = (string)Session["LinkedInProfileIdForFeeds"];
                linkedinwallcount = linkedinwallcount + 10;
            }
            Api.Groups.Groups ApiobjGroups                               = new Api.Groups.Groups();
            Domain.Socioboard.Domain.Groups objGroups                    = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
            Api.LinkedInFeed.LinkedInFeed   ApiobjLinkedInFeed           = new Api.LinkedInFeed.LinkedInFeed();
            List <Domain.Socioboard.Domain.LinkedInFeed> lstLinkedInFeed = (List <Domain.Socioboard.Domain.LinkedInFeed>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedInFeed.GetLinkedInFeeds1(objGroups.UserId.ToString(), profileid, linkedinwallcount), typeof(List <Domain.Socioboard.Domain.LinkedInFeed>)));

            //List<Domain.Socioboard.Domain.LinkedInFeed> lstLinkedInFeed = (List<Domain.Socioboard.Domain.LinkedInFeed>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedInFeed.GetLinkedInFeeds(objGroups.UserId.ToString(), profileid), typeof(List<Domain.Socioboard.Domain.LinkedInFeed>)));
            List <object> lstobject = new List <object>();

            foreach (var item in lstLinkedInFeed)
            {
                lstobject.Add(item);
            }
            dictwallposts.Add("linkedin", lstobject);
            return(PartialView("_Panel1Partial", dictwallposts));
        }
 public ActionResult AuthenticateFacebook()
 {
     try
     {
         try
         {
             Api.Groups.Groups objApiGroups = new Api.Groups.Groups();
             JObject group = JObject.Parse(objApiGroups.GetGroupDetailsByGroupId(Session["group"].ToString().ToString()));
             int profilecount = (Int16)(Session["ProfileCount"]);
             int totalaccount = (Int16)Session["TotalAccount"];
             if (Convert.ToString(group["GroupName"]) == ConfigurationManager.AppSettings["DefaultGroupName"].ToString())
             {
                 if (profilecount < totalaccount)
                 {
                     Session["fbSocial"] = "a";
                     string facebookurl = "http://www.facebook.com/dialog/oauth/?scope=user_friends,read_friendlists,publish_actions,publish_stream,read_stream,read_insights,manage_pages,user_checkins,user_photos,read_mailbox,manage_notifications,read_page_mailboxes,email,user_videos,user_groups,offline_access,publish_actions,manage_pages&client_id=" + ConfigurationManager.AppSettings["ClientId"] + "&redirect_uri=" + ConfigurationManager.AppSettings["RedirectUrl"] + "&response_type=code";
                     Response.Redirect(facebookurl);
                 }
                 else
                 {
                 }
             }
         }
         catch (Exception ex)
         {
         }
     }
     catch (Exception ex)
     {
     }
     return View();
 }
Example #10
0
        // Commented By Antima

        //public ActionResult TwitterNetworkDetails(string profileid)
        //{
        //    List<object> lstobject = new List<object>();
        //    Dictionary<string, List<object>> dictwallposts = new Dictionary<string, List<object>>();
        //    Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups();
        //    Domain.Socioboard.Domain.Groups objGroups = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
        //    Api.TwitterFeed.TwitterFeed ApiobjTwitterFeed = new Api.TwitterFeed.TwitterFeed();
        //    List<TwitterFeed> lstTwitterFeed = (List<TwitterFeed>)(new JavaScriptSerializer().Deserialize(ApiobjTwitterFeed.GetAllTwitterFeedsByUserIdAndProfileId(objGroups.UserId.ToString(), profileid), typeof(List<TwitterFeed>)));
        //    foreach (var twitterfeed in lstTwitterFeed)
        //    {
        //        lstobject.Add(twitterfeed);
        //    }
        //    dictwallposts.Add("twitter", lstobject);
        //    return PartialView("_Panel1Partial", dictwallposts);
        //}

        public ActionResult TwitterNetworkDetails(string profileid, string load)
        {
            List <object> lstobject = new List <object>();
            Dictionary <string, List <object> > dictwallposts = new Dictionary <string, List <object> >();

            if (load == "first")
            {
                Session["TwitterProfileIdForFeeds"] = profileid;
                twtwallcount = 0;
            }
            else
            {
                profileid    = (string)Session["TwitterProfileIdForFeeds"];
                twtwallcount = twtwallcount + 10;
            }
            Api.Groups.Groups ApiobjGroups                    = new Api.Groups.Groups();
            Domain.Socioboard.Domain.Groups objGroups         = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
            Api.TwitterFeed.TwitterFeed     ApiobjTwitterFeed = new Api.TwitterFeed.TwitterFeed();
            List <TwitterFeed> lstTwitterFeed                 = (List <TwitterFeed>)(new JavaScriptSerializer().Deserialize(ApiobjTwitterFeed.GetAllTwitterFeedsByUserIdAndProfileId1((objGroups.UserId.ToString()), profileid, twtwallcount), typeof(List <TwitterFeed>)));

            //List<TwitterFeed> lstTwitterFeed = (List<TwitterFeed>)(new JavaScriptSerializer().Deserialize(ApiobjTwitterFeed.GetAllTwitterFeedsByUserIdAndProfileId(objGroups.UserId.ToString(), profileid), typeof(List<TwitterFeed>)));
            foreach (var twitterfeed in lstTwitterFeed)
            {
                lstobject.Add(twitterfeed);
            }
            dictwallposts.Add("twitter", lstobject);
            return(PartialView("_Panel1Partial", dictwallposts));
        }
Example #11
0
        // Commented By Antima

        //public ActionResult TwitterFeeds(string profileid)
        //{
        //    List<object> lstobject = new List<object>();
        //    Dictionary<string, List<object>> dictwallposts = new Dictionary<string, List<object>>();
        //    Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups();
        //    Domain.Socioboard.Domain.Groups objGroups = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
        //    Api.TwitterMessage.TwitterMessage ApiobjTwitterMessage = new Api.TwitterMessage.TwitterMessage();
        //    List<TwitterMessage> lstTwitterMessage = (List<TwitterMessage>)(new JavaScriptSerializer().Deserialize(ApiobjTwitterMessage.GetTwitterMessages(profileid, objGroups.UserId.ToString()), typeof(List<TwitterMessage>)));
        //    foreach (var twittermsg in lstTwitterMessage)
        //    {
        //        lstobject.Add(twittermsg);
        //    }
        //    dictwallposts.Add("twitter", lstobject);
        //    return PartialView("_Panel2Partial", dictwallposts);
        //}

        public ActionResult TwitterFeeds(string profileid, string load)
        {
            List <object> lstobject = new List <object>();

            if (load == "first")
            {
                Session["TwitterProfileIdForFeeds"] = profileid;
                twtfeedcount = 0;
            }
            else
            {
                profileid    = (string)Session["TwitterProfileIdForFeeds"];
                twtfeedcount = twtfeedcount + 10;
            }

            Dictionary <string, List <object> > dictwallposts = new Dictionary <string, List <object> >();

            Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups();
            Domain.Socioboard.Domain.Groups   objGroups            = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
            Api.TwitterMessage.TwitterMessage ApiobjTwitterMessage = new Api.TwitterMessage.TwitterMessage();
            List <TwitterMessage>             lstTwitterMessage    = (List <TwitterMessage>)(new JavaScriptSerializer().Deserialize(ApiobjTwitterMessage.GetTwitterMessages1(profileid, objGroups.UserId.ToString(), twtfeedcount), typeof(List <TwitterMessage>)));

            foreach (var twittermsg in lstTwitterMessage)
            {
                lstobject.Add(twittermsg);
            }
            dictwallposts.Add("twitter", lstobject);
            return(PartialView("_Panel2Partial", dictwallposts));
        }
Example #12
0
        // Commented By Antima

        //public ActionResult AjaxFeeds(string profileid)
        //{
        //    List<object> lstobject = new List<object>();
        //    Dictionary<string, List<object>> dictwallposts = new Dictionary<string, List<object>>();
        //    Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups();
        //    Domain.Socioboard.Domain.Groups objGroups = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
        //    Api.FacebookFeed.FacebookFeed ApiobjFacebookFeed = new Api.FacebookFeed.FacebookFeed();
        //    List<FacebookFeed> lstFacebookFeed = (List<FacebookFeed>)(new JavaScriptSerializer().Deserialize(ApiobjFacebookFeed.getAllFacebookFeedsByUserIdAndProfileId(objGroups.UserId.ToString(), profileid), typeof(List<FacebookFeed>)));
        //    foreach (var twittermsg in lstFacebookFeed)
        //    {
        //        lstobject.Add(twittermsg);
        //    }
        //    dictwallposts.Add("facebook", lstobject);
        //    return PartialView("_Panel2Partial", dictwallposts);
        //}

        public ActionResult AjaxFeeds(string profileid, string load)
        {
            List <object> lstobject = new List <object>();

            if (load == "first")
            {
                Session["FacebookProfileIdForFeeds"] = profileid;
                facebookfeedcount = 0;
            }
            else
            {
                profileid         = (string)Session["FacebookProfileIdForFeeds"];
                facebookfeedcount = facebookfeedcount + 10;
            }
            Dictionary <string, List <object> > dictwallposts = new Dictionary <string, List <object> >();

            Api.Groups.Groups ApiobjGroups                     = new Api.Groups.Groups();
            Domain.Socioboard.Domain.Groups objGroups          = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
            Api.FacebookFeed.FacebookFeed   ApiobjFacebookFeed = new Api.FacebookFeed.FacebookFeed();
            List <FacebookFeed>             lstFacebookFeed    = (List <FacebookFeed>)(new JavaScriptSerializer().Deserialize(ApiobjFacebookFeed.getAllFacebookFeedsByUserIdAndProfileId1(objGroups.UserId.ToString(), profileid, facebookfeedcount), typeof(List <FacebookFeed>)));

            foreach (var twittermsg in lstFacebookFeed)
            {
                lstobject.Add(twittermsg);
            }
            dictwallposts.Add("facebook", lstobject);
            return(PartialView("_Panel2Partial", dictwallposts));
        }
Example #13
0
 public ActionResult AuthenticateFacebook()
 {
     try
     {
         try
         {
             Api.Groups.Groups objApiGroups = new Api.Groups.Groups();
             JObject           group        = JObject.Parse(objApiGroups.GetGroupDetailsByGroupId(Session["group"].ToString().ToString()));
             int profilecount = (Int16)(Session["ProfileCount"]);
             int totalaccount = (Int16)Session["TotalAccount"];
             if (Convert.ToString(group["GroupName"]) == ConfigurationManager.AppSettings["DefaultGroupName"].ToString())
             {
                 if (profilecount < totalaccount)
                 {
                     Session["fbSocial"] = "a";
                     string facebookurl = "http://www.facebook.com/dialog/oauth/?scope=user_friends,read_friendlists,publish_actions,publish_stream,read_stream,read_insights,manage_pages,user_checkins,user_photos,read_mailbox,manage_notifications,read_page_mailboxes,email,user_videos,user_groups,offline_access,publish_actions,manage_pages&client_id=" + ConfigurationManager.AppSettings["ClientId"] + "&redirect_uri=" + ConfigurationManager.AppSettings["RedirectUrl"] + "&response_type=code";
                     Response.Redirect(facebookurl);
                 }
                 else
                 {
                 }
             }
         }
         catch (Exception ex)
         {
         }
     }
     catch (Exception ex)
     {
     }
     return(View());
 }
Example #14
0
        public static Dictionary<Domain.Socioboard.Domain.TeamMemberProfile, object> GetUserProfilesccordingToGroup()
        {
            User objUser = (User)System.Web.HttpContext.Current.Session["User"];
            Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups();
            ApiobjGroups.Timeout = 300000;
            //ApiobjGroups.GetGroupDetailsByGroupId
            Groups objGroups = (Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(System.Web.HttpContext.Current.Session["group"].ToString()), typeof(Groups)));
            Dictionary<Domain.Socioboard.Domain.TeamMemberProfile, object> dict_TeamMember = new Dictionary<Domain.Socioboard.Domain.TeamMemberProfile, object>();
            Api.Team.Team objApiTeam = new Api.Team.Team();
            objApiTeam.Timeout = 300000;
            JObject team = JObject.Parse(objApiTeam.GetTeamByGroupId(System.Web.HttpContext.Current.Session["group"].ToString()));
            Api.TeamMemberProfile.TeamMemberProfile objApiTeamMemberProfile = new Api.TeamMemberProfile.TeamMemberProfile();
            objApiTeamMemberProfile.Timeout = 300000;
            JArray TeamMemberProfiles = JArray.Parse(objApiTeamMemberProfile.GetTeamMemberProfilesByTeamId(Convert.ToString(team["Id"])));
            foreach (var item in TeamMemberProfiles)
            {
                try
                {
                    Domain.Socioboard.Domain.TeamMemberProfile objTeamMemberProfile = GetTeamMemberProfileFromJObject(item);

                    ISocialSiteAccount objISocialSiteAccount = GetSocialAccountFromTeamMemberProfile(objGroups.UserId, objTeamMemberProfile);
                    SocialSiteAccountFactory objSocialSiteAccountFactory = new SocialSiteAccountFactory(objTeamMemberProfile.ProfileType);
                    dict_TeamMember.Add(objTeamMemberProfile, objISocialSiteAccount);
                }
                catch (Exception ex)
                {

                    Console.WriteLine(ex.Message);
                    //return null;
                }
            }
            return dict_TeamMember;


        }
Example #15
0
        public ActionResult wallposts(string op, string load, string profileid)
        {
            Dictionary <string, List <object> > dictwallposts = new Dictionary <string, List <object> >();

            if (load == "first")
            {
                Session["FacebookProfileIdForFeeds"] = profileid;
                facebookwallcount = 0;
            }
            else
            {
                profileid         = (string)Session["FacebookProfileIdForFeeds"];
                facebookwallcount = facebookwallcount + 10;
            }
            Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups();
            Domain.Socioboard.Domain.Groups                 objGroups             = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
            Api.FacebookMessage.FacebookMessage             ApiobjFacebookMessage = new Api.FacebookMessage.FacebookMessage();
            List <Domain.Socioboard.Domain.FacebookMessage> lstFacebookMessage    = (List <Domain.Socioboard.Domain.FacebookMessage>)(new JavaScriptSerializer().Deserialize(ApiobjFacebookMessage.GetAllWallpostsOfProfileAccordingtoGroup(profileid, facebookwallcount, objGroups.UserId.ToString()), typeof(List <Domain.Socioboard.Domain.FacebookMessage>)));
            List <object> lstobject = new List <object>();

            foreach (var item in lstFacebookMessage)
            {
                lstobject.Add(item);
            }
            dictwallposts.Add("facebook", lstobject);
            return(PartialView("_Panel1Partial", dictwallposts));
        }
Example #16
0
        public ActionResult TumblrImages(string profileid)
        {
            //List<object> lstobject = new List<object>();
            //Dictionary<string, List<object>> dictwallposts = new Dictionary<string, List<object>>();
            //Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups();
            //Domain.Socioboard.Domain.Groups objGroups = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
            //Api.TumblrFeed.TumblrFeed ApiobjTumblrFeed = new Api.TumblrFeed.TumblrFeed();
            //List<Domain.Socioboard.Domain.TumblrFeed> lstInstagramFeed = (List<Domain.Socioboard.Domain.TumblrFeed>)(new JavaScriptSerializer().Deserialize(ApiobjTumblrFeed.GetAllTumblrFeedOfUsers(objGroups.UserId.ToString(), profileid), typeof(List<Domain.Socioboard.Domain.TumblrFeed>)));
            //foreach (var lstInstagramfeed in lstInstagramFeed)
            //{
            //    lstobject.Add(lstInstagramfeed);
            //}
            //dictwallposts.Add("tumblr", lstobject);
            //return PartialView("_ImagePartial", dictwallposts);

            object        lstobject  = new object();
            List <object> lstComment = null;
            Dictionary <string, Dictionary <object, List <object> > > dictwallposts = new Dictionary <string, Dictionary <object, List <object> > >();
            Dictionary <object, List <object> > dic_TumblrImg = new Dictionary <object, List <object> >();

            Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups();
            Domain.Socioboard.Domain.Groups            objGroups        = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
            Api.TumblrFeed.TumblrFeed                  ApiobjTumblrFeed = new Api.TumblrFeed.TumblrFeed();
            List <Domain.Socioboard.Domain.TumblrFeed> lstTumblrFeed    = (List <Domain.Socioboard.Domain.TumblrFeed>)(new JavaScriptSerializer().Deserialize(ApiobjTumblrFeed.GetAllTumblrFeedOfUsers(objGroups.UserId.ToString(), profileid), typeof(List <Domain.Socioboard.Domain.TumblrFeed>)));

            foreach (var item_lstTumblrFeed in lstTumblrFeed)
            {
                lstComment = new List <object>();

                lstobject = (object)item_lstTumblrFeed;
                dic_TumblrImg.Add(lstobject, lstComment);
            }
            dictwallposts.Add("tumblr", dic_TumblrImg);
            return(PartialView("_ImagePartial", dictwallposts));
        }
        public ActionResult DeleteGroup(string Groupid)
        {
            User objUser = (User)Session["User"];

            Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups();
            ApiobjGroups.DeleteGroupById(Groupid, objUser.Id.ToString());
            return(Content(""));
        }
        public ActionResult AuthenticateFacebook(string op)
        {
            string facebookurl = "../index/index";

            if (!string.IsNullOrEmpty(op))
            {
                if (op == "fbgroup")
                {
                    Session["fblogin"] = op;
                    facebookurl        = Helper.SBUtils.GetFacebookRedirectLink();
                }
                else if (op == "page")
                {
                    Session["fblogin"] = op;
                    facebookurl        = Helper.SBUtils.GetFacebookRedirectLink();
                }
                else if (op == "fblogin")
                {
                    Session["fblogin"] = op;

                    facebookurl = Helper.SBUtils.GetFacebookRedirectLink();
                }
            }
            else if (op == "fblogin")
            {
                Session["fblogin"] = op;

                facebookurl = Helper.SBUtils.GetFacebookRedirectLink();
            }
            else
            {
                try
                {
                    try
                    {
                        Api.Groups.Groups objApiGroups = new Api.Groups.Groups();
                        logger.Error(Session["group"]);
                        logger.Error(Session["group"].ToString());
                        JObject group = JObject.Parse(objApiGroups.GetGroupDetailsByGroupId(Session["group"].ToString().ToString()));

                        Session["fbSocial"] = "a";
                        facebookurl         = Helper.SBUtils.GetFacebookRedirectLink();
                        Response.Redirect(facebookurl);
                    }
                    catch (Exception ex)
                    {
                        logger.Error("ex.Message : " + ex.Message);
                        logger.Error("ex.StackTrace : " + ex.StackTrace);
                    }
                }
                catch (Exception ex)
                {
                    logger.Error(ex.Message);
                }
            }
            return(Content(facebookurl));
        }
 public ActionResult AuthenticateTumblr()
 {
     try
     {
         try
         {
             Api.Groups.Groups objApiGroups = new Api.Groups.Groups();
             JObject group = JObject.Parse(objApiGroups.GetGroupDetailsByGroupId(Session["group"].ToString().ToString()));
             int profilecount = 0;
             int totalaccount = 0;
             try
             {
                 profilecount = (Int16)(Session["ProfileCount"]);
                 totalaccount = (Int16)Session["TotalAccount"];
             }
             catch (Exception ex)
             {
                 logger.Error("ex.Message : " + ex.Message);
                 logger.Error("ex.StackTrace : " + ex.StackTrace);
             }
             if (Convert.ToString(group["GroupName"]) == ConfigurationManager.AppSettings["DefaultGroupName"].ToString())
             {
                 if (profilecount < totalaccount)
                 {
                     Api.Tumblr.Tumblr ApiobjTumblr = new Api.Tumblr.Tumblr();
                     string redircturl = ApiobjTumblr.GetTumblrRedirectUrl(ConfigurationManager.AppSettings["TumblrClientKey"], ConfigurationManager.AppSettings["TumblrClientSec"], ConfigurationManager.AppSettings["TumblrCallBackURL"]);
                     Response.Redirect(redircturl);
                 }
                 else if (profilecount == 0 || totalaccount == 0)
                 {
                     Api.Tumblr.Tumblr ApiobjTumblr = new Api.Tumblr.Tumblr();
                     string redircturl = ApiobjTumblr.GetTumblrRedirectUrl(ConfigurationManager.AppSettings["TumblrClientKey"], ConfigurationManager.AppSettings["TumblrClientSec"], ConfigurationManager.AppSettings["TumblrCallBackURL"]);
                     Response.Redirect(redircturl);
                 }
                 else
                 {
                     return RedirectToAction("Index", "Home");
                 }
             }
             else 
             {
                 logger.Error("AuthenticateTumblr =>" + Convert.ToString(group["GroupName"]) + "!=" + ConfigurationManager.AppSettings["DefaultGroupName"].ToString());
                 return RedirectToAction("Index", "Home");
             }
         }
         catch (Exception ex)
         {
             logger.Error("AuthenticateTumblr => "+ex.Message);
             logger.Error("AuthenticateTumblr => "+ex.StackTrace);
             return RedirectToAction("Index", "Home");
         }
     }
     catch (Exception ex)
     {
     }
     return RedirectToAction("Index", "Home");
 }
        public ActionResult AuthenticateLinkedin()
        {

            try
            {
                try
                {
                    Api.Groups.Groups objApiGroups = new Api.Groups.Groups();
                    JObject group = JObject.Parse(objApiGroups.GetGroupDetailsByGroupId(Session["group"].ToString().ToString()));
                    int profilecount = 0;
                    int totalaccount = 0;
                    try
                    {
                        profilecount = (Int16)(Session["ProfileCount"]);
                        totalaccount = (Int16)Session["TotalAccount"];
                    }
                    catch (Exception ex)
                    {
                        logger.Error("ex.Message : " + ex.Message);
                        logger.Error("ex.StackTrace : " + ex.StackTrace);
                    }
                    if (Convert.ToString(group["GroupName"]) == ConfigurationManager.AppSettings["DefaultGroupName"].ToString())
                    {
                        if (profilecount < totalaccount)
                        {
                            Session["linSocial"] = "a";
                            Api.Linkedin.Linkedin objApiLinkedin = new Api.Linkedin.Linkedin();
                            string redircturl = objApiLinkedin.GetLinkedinRedirectUrl(ConfigurationManager.AppSettings["LiApiKey"], ConfigurationManager.AppSettings["LiSecretKey"]);
                            Session["reuqestToken"] = redircturl.Split('~')[1].ToString();
                            Session["reuqestTokenSecret"] = redircturl.Split('~')[2].ToString();
                            redircturl = redircturl.Split('~')[0].ToString();
                            Response.Redirect(redircturl);
                        }
                        else if (profilecount == 0 || totalaccount == 0)
                        {
                            Session["linSocial"] = "a";
                            Api.Linkedin.Linkedin objApiLinkedin = new Api.Linkedin.Linkedin();
                            string redircturl = objApiLinkedin.GetLinkedinRedirectUrl(ConfigurationManager.AppSettings["LiApiKey"], ConfigurationManager.AppSettings["LiSecretKey"]);
                            Session["reuqestToken"] = redircturl.Split('~')[1].ToString();
                            Session["reuqestTokenSecret"] = redircturl.Split('~')[2].ToString();
                            redircturl = redircturl.Split('~')[0].ToString();
                            Response.Redirect(redircturl);
                        }
                        else
                        {
                        }
                    }
                }
                catch (Exception ex)
                {
                }
            }
            catch (Exception ex)
            {
            }
            return View();
        }
Example #21
0
        public ActionResult FacebookLike(string fbid, string profileid, string msgid)
        {
            Api.Groups.Groups ApiobjGroups                 = new Api.Groups.Groups();
            Domain.Socioboard.Domain.Groups objGroups      = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
            Api.Facebook.Facebook           ApiobjFacebook = new Api.Facebook.Facebook();
            string ret = ApiobjFacebook.FacebookLike(msgid, profileid, fbid, objGroups.UserId.ToString());

            return(Content(ret));
        }
 public ActionResult AuthenticateTumblr()
 {
     try
     {
         try
         {
             Api.Groups.Groups objApiGroups = new Api.Groups.Groups();
             JObject           group        = JObject.Parse(objApiGroups.GetGroupDetailsByGroupId(Session["group"].ToString().ToString()));
             int profilecount = 0;
             int totalaccount = 0;
             try
             {
                 profilecount = (Int16)(Session["ProfileCount"]);
                 totalaccount = (Int16)Session["TotalAccount"];
             }
             catch (Exception ex)
             {
                 logger.Error("ex.Message : " + ex.Message);
                 logger.Error("ex.StackTrace : " + ex.StackTrace);
             }
             if (Convert.ToString(group["GroupName"]) == ConfigurationManager.AppSettings["DefaultGroupName"].ToString())
             {
                 if (profilecount < totalaccount)
                 {
                     Api.Tumblr.Tumblr ApiobjTumblr = new Api.Tumblr.Tumblr();
                     string            redircturl   = ApiobjTumblr.GetTumblrRedirectUrl(ConfigurationManager.AppSettings["TumblrClientKey"], ConfigurationManager.AppSettings["TumblrClientSec"], ConfigurationManager.AppSettings["TumblrCallBackURL"]);
                     Response.Redirect(redircturl);
                 }
                 else if (profilecount == 0 || totalaccount == 0)
                 {
                     Api.Tumblr.Tumblr ApiobjTumblr = new Api.Tumblr.Tumblr();
                     string            redircturl   = ApiobjTumblr.GetTumblrRedirectUrl(ConfigurationManager.AppSettings["TumblrClientKey"], ConfigurationManager.AppSettings["TumblrClientSec"], ConfigurationManager.AppSettings["TumblrCallBackURL"]);
                     Response.Redirect(redircturl);
                 }
                 else
                 {
                     return(RedirectToAction("Index", "Home"));
                 }
             }
             else
             {
                 logger.Error("AuthenticateTumblr =>" + Convert.ToString(group["GroupName"]) + "!=" + ConfigurationManager.AppSettings["DefaultGroupName"].ToString());
                 return(RedirectToAction("Index", "Home"));
             }
         }
         catch (Exception ex)
         {
             logger.Error("AuthenticateTumblr => " + ex.Message);
             logger.Error("AuthenticateTumblr => " + ex.StackTrace);
             return(RedirectToAction("Index", "Home"));
         }
     }
     catch (Exception ex)
     {
     }
     return(RedirectToAction("Index", "Home"));
 }
Example #23
0
 public ActionResult AuthenticateLinkedin()
 {
     try
     {
         try
         {
             Api.Groups.Groups objApiGroups = new Api.Groups.Groups();
             JObject           group        = JObject.Parse(objApiGroups.GetGroupDetailsByGroupId(Session["group"].ToString().ToString()));
             int profilecount = 0;
             int totalaccount = 0;
             try
             {
                 profilecount = (Int16)(Session["ProfileCount"]);
                 totalaccount = (Int16)Session["TotalAccount"];
             }
             catch (Exception ex)
             {
                 logger.Error("ex.Message : " + ex.Message);
                 logger.Error("ex.StackTrace : " + ex.StackTrace);
             }
             if (Convert.ToString(group["GroupName"]) == ConfigurationManager.AppSettings["DefaultGroupName"].ToString())
             {
                 if (profilecount < totalaccount)
                 {
                     Session["linSocial"] = "a";
                     Api.Linkedin.Linkedin objApiLinkedin = new Api.Linkedin.Linkedin();
                     string redircturl = objApiLinkedin.GetLinkedinRedirectUrl(ConfigurationManager.AppSettings["LiApiKey"], ConfigurationManager.AppSettings["LiSecretKey"]);
                     Session["reuqestToken"]       = redircturl.Split('~')[1].ToString();
                     Session["reuqestTokenSecret"] = redircturl.Split('~')[2].ToString();
                     redircturl = redircturl.Split('~')[0].ToString();
                     Response.Redirect(redircturl);
                 }
                 else if (profilecount == 0 || totalaccount == 0)
                 {
                     Session["linSocial"] = "a";
                     Api.Linkedin.Linkedin objApiLinkedin = new Api.Linkedin.Linkedin();
                     string redircturl = objApiLinkedin.GetLinkedinRedirectUrl(ConfigurationManager.AppSettings["LiApiKey"], ConfigurationManager.AppSettings["LiSecretKey"]);
                     Session["reuqestToken"]       = redircturl.Split('~')[1].ToString();
                     Session["reuqestTokenSecret"] = redircturl.Split('~')[2].ToString();
                     redircturl = redircturl.Split('~')[0].ToString();
                     Response.Redirect(redircturl);
                 }
                 else
                 {
                 }
             }
         }
         catch (Exception ex)
         {
         }
     }
     catch (Exception ex)
     {
     }
     return(View());
 }
Example #24
0
        public ActionResult AuthenticateInstagram()
        {
            try
            {
                try
                {
                    Api.Groups.Groups objApiGroups = new Api.Groups.Groups();
                    JObject           group        = JObject.Parse(objApiGroups.GetGroupDetailsByGroupId(Session["group"].ToString().ToString()));
                    int profilecount = 0;
                    int totalaccount = 0;
                    try
                    {
                        profilecount = (Int16)(Session["ProfileCount"]);
                        totalaccount = (Int16)Session["TotalAccount"];
                    }
                    catch (Exception ex)
                    {
                        logger.Error("ex.Message : " + ex.Message);
                        logger.Error("ex.StackTrace : " + ex.StackTrace);
                    }

                    if (Convert.ToString(group["GroupName"]) == ConfigurationManager.AppSettings["DefaultGroupName"].ToString())
                    {
                        if (profilecount < totalaccount)
                        {
                            Api.Instagram.Instagram ApiobjInstagram = new Api.Instagram.Instagram();
                            string redirecturl = ApiobjInstagram.GetInstagramRedirectUrl(ConfigurationManager.AppSettings["InstagramClientKey"], ConfigurationManager.AppSettings["InstagramClientSec"], ConfigurationManager.AppSettings["InstagramCallBackURL"]);
                            Response.Redirect(redirecturl);
                        }
                        else if (profilecount == 0 || totalaccount == 0)
                        {
                            Api.Instagram.Instagram ApiobjInstagram = new Api.Instagram.Instagram();
                            string redirecturl = ApiobjInstagram.GetInstagramRedirectUrl(ConfigurationManager.AppSettings["InstagramClientKey"], ConfigurationManager.AppSettings["InstagramClientSec"], ConfigurationManager.AppSettings["InstagramCallBackURL"]);
                            Response.Redirect(redirecturl);
                        }
                        else
                        {
                            //return JavaScript("alert(\"You can't add more than "+ totalaccount +" account!\")");
                            Response.Redirect("../Home/Index");
                        }
                    }
                    else
                    {
                        Response.Redirect("../Home/Index");
                    }
                }
                catch (Exception ex)
                {
                }
            }
            catch (Exception ex)
            {
            }
            return(View());
        }
        public ActionResult AuthenticateYoutube(string op)
        {
            string googleurl = string.Empty;

            if (!string.IsNullOrEmpty(op))
            {
                Session["googlepluslogin"] = op;
                googleurl = "https://accounts.google.com/o/oauth2/auth?client_id=" + ConfigurationManager.AppSettings["YtconsumerKey"] + "&redirect_uri=" + ConfigurationManager.AppSettings["Ytredirect_uri"] + "&scope=https://www.googleapis.com/auth/youtube+https://www.googleapis.com/auth/youtube.readonly+https://www.googleapis.com/auth/youtubepartner+https://www.googleapis.com/auth/youtubepartner-channel-audit+https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/userinfo.profile+https://www.googleapis.com/auth/plus.me&response_type=code&access_type=offline";
            }
            else
            {
                try
                {
                    try
                    {
                        Api.Groups.Groups objApiGroups = new Api.Groups.Groups();
                        JObject           group        = JObject.Parse(objApiGroups.GetGroupDetailsByGroupId(Session["group"].ToString().ToString()));
                        int profilecount = 0;
                        int totalaccount = 0;
                        try
                        {
                            profilecount = (Int16)(Session["ProfileCount"]);
                            totalaccount = (Int16)Session["TotalAccount"];
                        }
                        catch (Exception ex)
                        {
                            logger.Error("ex.Message : " + ex.Message);
                            logger.Error("ex.StackTrace : " + ex.StackTrace);
                        }
                        {
                            if (profilecount < totalaccount)
                            {
                                //string redirect = "https://accounts.google.com/o/oauth2/auth?client_id=" + ConfigurationManager.AppSettings["YtconsumerKey"] + "&redirect_uri=" + ConfigurationManager.AppSettings["Ytredirect_uri"] + "&scope=https://www.googleapis.com/auth/youtube+https://www.googleapis.com/auth/youtube.readonly+https://www.googleapis.com/auth/youtubepartner+https://www.googleapis.com/auth/youtubepartner-channel-audit+https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/userinfo.profile+https://www.googleapis.com/auth/plus.me&response_type=code&access_type=offline";
                                Response.Redirect("https://accounts.google.com/o/oauth2/auth?client_id=" + ConfigurationManager.AppSettings["YtconsumerKey"] + "&redirect_uri=" + ConfigurationManager.AppSettings["Ytredirect_uri"] + "&scope=https://www.googleapis.com/auth/youtube+https://www.googleapis.com/auth/youtube.readonly+https://www.googleapis.com/auth/youtubepartner+https://www.googleapis.com/auth/youtubepartner-channel-audit+https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/userinfo.profile+https://www.googleapis.com/auth/plus.me&response_type=code&access_type=offline");
                            }
                            else if (profilecount == 0 || totalaccount == 0)
                            {
                                Response.Redirect("https://accounts.google.com/o/oauth2/auth?client_id=" + ConfigurationManager.AppSettings["YtconsumerKey"] + "&redirect_uri=" + ConfigurationManager.AppSettings["Ytredirect_uri"] + "&scope=https://www.googleapis.com/auth/youtube+https://www.googleapis.com/auth/youtube.readonly+https://www.googleapis.com/auth/youtubepartner+https://www.googleapis.com/auth/youtubepartner-channel-audit+https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/userinfo.profile+https://www.googleapis.com/auth/plus.me&response_type=code&access_type=offline");
                            }
                            else
                            {
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                    }
                }
                catch (Exception ex)
                {
                }
            }
            return(Content(googleurl));
        }
Example #26
0
        public ActionResult YoutubeChannelVideos(string profileid)
        {
            //List<object> lstobject = new List<object>();
            //Dictionary<string, List<object>> dictwallposts = new Dictionary<string, List<object>>();
            //Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups();
            //Domain.Socioboard.Domain.Groups objGroups = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
            //Api.Youtube.Youtube ApiobjYoutube = new Api.Youtube.Youtube();
            //string channeldetails = ApiobjYoutube.GetYoutubeChannelVideos(objGroups.UserId.ToString(), profileid);
            //JObject obj = JObject.Parse(channeldetails);
            //JArray array = (JArray)obj["items"];

            //foreach (var item in array)
            //{
            //    try
            //    {
            //        lstobject.Add(item["snippet"]["thumbnails"]["maxres"]["url"].ToString());
            //    }
            //    catch (Exception ex)
            //    {
            //        Console.WriteLine(ex.StackTrace);
            //    }
            //}
            //dictwallposts.Add("youtube", lstobject);
            //return PartialView("_ImagePartial", dictwallposts);

            object        lstobject  = new object();
            List <object> lstComment = null;
            Dictionary <string, Dictionary <object, List <object> > > dictwallposts = new Dictionary <string, Dictionary <object, List <object> > >();
            Dictionary <object, List <object> > dic_youtube = new Dictionary <object, List <object> >();

            Api.Groups.Groups ApiobjGroups                = new Api.Groups.Groups();
            Domain.Socioboard.Domain.Groups objGroups     = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
            Api.Youtube.Youtube             ApiobjYoutube = new Api.Youtube.Youtube();
            string  channeldetails = ApiobjYoutube.GetYoutubeChannelVideos(objGroups.UserId.ToString(), profileid);
            JObject obj            = JObject.Parse(channeldetails);
            JArray  array          = (JArray)obj["items"];

            foreach (var item in array)
            {
                try
                {
                    lstComment = new List <object>();
                    lstobject  = (object)item["snippet"]["thumbnails"]["maxres"]["url"].ToString();
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.StackTrace);
                }
                dic_youtube.Add(lstobject, lstComment);
            }
            dictwallposts.Add("youtube", dic_youtube);
            return(PartialView("_ImagePartial", dictwallposts));
        }
 public ActionResult AuthenticateLinkedin(string op)
 {
     try
     {
         try
         {
             Api.Groups.Groups objApiGroups = new Api.Groups.Groups();
             JObject           group        = JObject.Parse(objApiGroups.GetGroupDetailsByGroupId(Session["group"].ToString().ToString()));
             int    profilecount            = 0;
             int    totalaccount            = 0;
             Random ran = new Random();
             int    x   = ran.Next(8976557);
             try
             {
                 profilecount = (Int16)(Session["ProfileCount"]);
                 totalaccount = (Int16)Session["TotalAccount"];
             }
             catch (Exception ex)
             {
                 logger.Error("ex.Message : " + ex.Message);
                 logger.Error("ex.StackTrace : " + ex.StackTrace);
             }
             if (Convert.ToString(group["GroupName"]) == ConfigurationManager.AppSettings["DefaultGroupName"].ToString())
             {
                 if (profilecount < totalaccount)
                 {
                     if (op != "page")
                     {
                         Session["linkedinSocial"] = "AddProfile";
                         Response.Redirect("https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=" + ConfigurationManager.AppSettings["LinkedinApiKey"] + "&redirect_uri=" + System.Web.HttpUtility.UrlEncode(ConfigurationManager.AppSettings["LinkedinCallBackURL"]) + "&state=" + x.ToString() + "&?scope=r_basicprofile+w_share");
                     }
                     else
                     {
                         Session["linkedinSocial"] = "LinkedinCompanyPage";
                         Response.Redirect("https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=" + ConfigurationManager.AppSettings["LinkedinApiKey"] + "&redirect_uri=" + System.Web.HttpUtility.UrlEncode(ConfigurationManager.AppSettings["LinkedinCallBackURL"]) + "&state=" + x.ToString() + "&?scope=r_basicprofile+w_share+rw_company_admin");
                     }
                 }
             }
         }
         catch (Exception ex)
         {
         }
     }
     catch (Exception ex)
     {
     }
     return(View());
 }
Example #28
0
        public ActionResult TwitterFeeds(string profileid)
        {
            List <object> lstobject = new List <object>();
            Dictionary <string, List <object> > dictwallposts = new Dictionary <string, List <object> >();

            Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups();
            Domain.Socioboard.Domain.Groups   objGroups            = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
            Api.TwitterMessage.TwitterMessage ApiobjTwitterMessage = new Api.TwitterMessage.TwitterMessage();
            List <TwitterMessage>             lstTwitterMessage    = (List <TwitterMessage>)(new JavaScriptSerializer().Deserialize(ApiobjTwitterMessage.GetTwitterMessages(profileid, objGroups.UserId.ToString()), typeof(List <TwitterMessage>)));

            foreach (var twittermsg in lstTwitterMessage)
            {
                lstobject.Add(twittermsg);
            }
            dictwallposts.Add("twitter", lstobject);
            return(PartialView("_Panel2Partial", dictwallposts));
        }
Example #29
0
        public ActionResult LinkedinFeeds(string profileid)
        {
            List <object> lstobject = new List <object>();
            Dictionary <string, List <object> > dictwallposts = new Dictionary <string, List <object> >();

            Api.Groups.Groups ApiobjGroups                 = new Api.Groups.Groups();
            Domain.Socioboard.Domain.Groups objGroups      = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
            Api.Linkedin.Linkedin           ApiobjLinkedin = new Api.Linkedin.Linkedin();
            List <Domain.Socioboard.Domain.LinkedInUser.User_Updates> lstlinkedinFeeds = (List <Domain.Socioboard.Domain.LinkedInUser.User_Updates>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedin.GetLinkedUserUpdates(profileid, objGroups.UserId.ToString()), typeof(List <Domain.Socioboard.Domain.LinkedInUser.User_Updates>)));

            foreach (var linkledinfeed in lstlinkedinFeeds)
            {
                lstobject.Add(linkledinfeed);
            }
            dictwallposts.Add("linkedin", lstobject);
            return(PartialView("_Panel2Partial", dictwallposts));
        }
Example #30
0
        public ActionResult AuthenticateFacebook(string op)
        {
            string facebookurl = string.Empty;

            if (!string.IsNullOrEmpty(op))
            {
                Session["fblogin"] = op;
                facebookurl        = Helper.SBUtils.GetFacebookRedirectLink();
                // Response.Redirect(facebookurl, true);
            }
            else
            {
                try
                {
                    try
                    {
                        Api.Groups.Groups objApiGroups = new Api.Groups.Groups();
                        JObject           group        = JObject.Parse(objApiGroups.GetGroupDetailsByGroupId(Session["group"].ToString().ToString()));
                        int profilecount = (Int16)(Session["ProfileCount"]);
                        int totalaccount = (Int16)Session["TotalAccount"];
                        if (Convert.ToString(group["GroupName"]) == "Socioboard")
                        {
                            if (profilecount < totalaccount)
                            {
                                Session["fbSocial"] = "a";
                                facebookurl         = Helper.SBUtils.GetFacebookRedirectLink();
                                Response.Redirect(facebookurl);
                            }
                            else
                            {
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        logger.Error(ex.Message);
                    }
                }
                catch (Exception ex)
                {
                    logger.Error(ex.Message);
                }
            }
            return(Content(facebookurl));
        }
Example #31
0
        public ActionResult FacebookTag(string ProfileId)
        {
            List <object> lstobject = new List <object>();
            Dictionary <string, List <object> > dictTag = new Dictionary <string, List <object> >();

            Api.Groups.Groups ApiobjGroups            = new Api.Groups.Groups();
            Domain.Socioboard.Domain.Groups objGroups = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));

            Api.FacebookMessage.FacebookMessage ApiobjFacebookMessage = new Api.FacebookMessage.FacebookMessage();
            List <FacebookMessage> lstFacebookTag = (List <FacebookMessage>)(new JavaScriptSerializer().Deserialize(ApiobjFacebookMessage.getAllFacebookTagOfUsers(objGroups.UserId.ToString(), ProfileId), typeof(List <FacebookMessage>)));

            foreach (var FacebookTag in lstFacebookTag)
            {
                lstobject.Add(FacebookTag);
            }
            dictTag.Add("facebook", lstobject);
            return(PartialView("_Panel3Partial", dictTag));
        }
Example #32
0
        public ActionResult TwitterMentions(string ProfileId)
        {
            List <object> lstobject = new List <object>();
            Dictionary <string, List <object> > dictMentions = new Dictionary <string, List <object> >();

            Api.Groups.Groups ApiobjGroups            = new Api.Groups.Groups();
            Domain.Socioboard.Domain.Groups objGroups = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));

            Api.TwitterMessage.TwitterMessage ApiobjTwitterMessage = new Api.TwitterMessage.TwitterMessage();
            List <TwitterMessage>             lstTwitterMentions   = (List <TwitterMessage>)(new JavaScriptSerializer().Deserialize(ApiobjTwitterMessage.getAllTwitterMentionsOfUsers(objGroups.UserId.ToString(), ProfileId), typeof(List <TwitterMessage>)));

            foreach (var twitterMentions in lstTwitterMentions)
            {
                lstobject.Add(twitterMentions);
            }
            dictMentions.Add("twitter", lstobject);
            return(PartialView("_Panel3Partial", dictMentions));
        }
        //public ActionResult Linkedin()
        //{
        //    Session["LinkedinCompanyPage"] = null;
        //    Domain.Socioboard.Domain.User objUser = (Domain.Socioboard.Domain.User)Session["User"];
        //    string oauth_token = Request.QueryString["oauth_token"];
        //    string oauth_verifier = Request.QueryString["oauth_verifier"];
        //    string reuqestTokenSecret=Session["reuqestTokenSecret"].ToString();
        //    if (Session["linSocial"] == "a")
        //    {
        //        Api.Linkedin.Linkedin objApiLinkedin = new Api.Linkedin.Linkedin();
        //        string AddLinkedinAccount = objApiLinkedin.AddLinkedinAccount(oauth_token, oauth_verifier, reuqestTokenSecret, ConfigurationManager.AppSettings["LiApiKey"], ConfigurationManager.AppSettings["LiSecretKey"], objUser.Id.ToString(), Session["group"].ToString());
        //        Session["SocialManagerInfo"] = AddLinkedinAccount;
        //        return RedirectToAction("Index", "Home");
        //    }
        //    else

        //    {
        //        Api.LinkedinCompanyPage.LinkedinCompanyPage objLiCompanyPage = new Api.LinkedinCompanyPage.LinkedinCompanyPage();

        //        List<Helper.AddliPage> lstLinkedinCompanyPage = new List<Helper.AddliPage>();

        //        string page = objLiCompanyPage.GetLinkedinCompanyPage(oauth_token, oauth_verifier, reuqestTokenSecret, ConfigurationManager.AppSettings["LiApiKey"], ConfigurationManager.AppSettings["LiSecretKey"], objUser.Id.ToString(), Session["group"].ToString());
        //        lstLinkedinCompanyPage = (List<Helper.AddliPage>)(new JavaScriptSerializer().Deserialize(page, typeof(List<Helper.AddliPage>)));
        //        Session["LinkedinCompanyPage"] = lstLinkedinCompanyPage;
        //        return RedirectToAction("Index", "Home", new { hint = "linpage" });
        //    }
        //}
      

         public ActionResult linPage_connect()
        {
            string redirectURL = "";
            try
            {
                try
                {
                    Api.Groups.Groups objApiGroups = new Api.Groups.Groups();
                    JObject group = JObject.Parse(objApiGroups.GetGroupDetailsByGroupId(Session["group"].ToString().ToString()));
                    int profilecount = (Int16)(Session["ProfileCount"]);
                    int totalaccount = (Int16)Session["TotalAccount"];
                    if (Convert.ToString(group["GroupName"]) == ConfigurationManager.AppSettings["DefaultGroupName"].ToString())
                    {
                        if (profilecount < totalaccount)
                        {
                            Session["linSocial"] = "p";
                            Api.Linkedin.Linkedin objApiLinkedin = new Api.Linkedin.Linkedin();
                            string redircturl = objApiLinkedin.GetLinkedinRedirectUrl(ConfigurationManager.AppSettings["LiApiKey"], ConfigurationManager.AppSettings["LiSecretKey"]);
                            Session["reuqestToken"] = redircturl.Split('~')[1].ToString();
                            Session["reuqestTokenSecret"] = redircturl.Split('~')[2].ToString();
                            redircturl = redircturl.Split('~')[0].ToString();
                            redirectURL = redircturl;
                            //Response.Redirect(redircturl);

                        }
                        else
                        {
                        }
                    }
                }
                catch (Exception ex)
                {
                    logger.Error(ex.Message);

                }
            }
            catch (Exception ex)
            {
                logger.Error(ex.Message);
               
            }
            return Content(redirectURL);//View();
        }
Example #34
0
        public ActionResult linPage_connect()
        {
            string redirectURL = "";

            try
            {
                try
                {
                    Api.Groups.Groups objApiGroups = new Api.Groups.Groups();
                    JObject           group        = JObject.Parse(objApiGroups.GetGroupDetailsByGroupId(Session["group"].ToString().ToString()));
                    int profilecount = (Int16)(Session["ProfileCount"]);
                    int totalaccount = (Int16)Session["TotalAccount"];
                    if (Convert.ToString(group["GroupName"]) == ConfigurationManager.AppSettings["DefaultGroupName"].ToString())
                    {
                        if (profilecount < totalaccount)
                        {
                            Session["linSocial"] = "p";
                            Api.Linkedin.Linkedin objApiLinkedin = new Api.Linkedin.Linkedin();
                            string redircturl = objApiLinkedin.GetLinkedinRedirectUrl(ConfigurationManager.AppSettings["LiApiKey"], ConfigurationManager.AppSettings["LiSecretKey"]);
                            Session["reuqestToken"]       = redircturl.Split('~')[1].ToString();
                            Session["reuqestTokenSecret"] = redircturl.Split('~')[2].ToString();
                            redircturl  = redircturl.Split('~')[0].ToString();
                            redirectURL = redircturl;
                            //Response.Redirect(redircturl);
                        }
                        else
                        {
                        }
                    }
                }
                catch (Exception ex)
                {
                    logger.Error(ex.Message);
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex.Message);
            }
            return(Content(redirectURL));//View();
        }
Example #35
0
        public ActionResult LoadGroup()
        {
            User objUser = (User)Session["User"];

            Api.Groups.Groups objApiGroups = new Api.Groups.Groups();
            JArray            profile      = JArray.Parse(objApiGroups.GetGroupDetailsByUserId(objUser.Id.ToString()));

            List <Groups> lstgroup = new List <Groups>();

            foreach (var item in profile)
            {
                Groups objGroups = new Groups();
                objGroups.Id        = Guid.Parse(Convert.ToString(item["Id"]));
                objGroups.GroupName = Convert.ToString(item["GroupName"]);
                objGroups.UserId    = Guid.Parse(Convert.ToString(item["UserId"]));
                objGroups.EntryDate = Convert.ToDateTime(Convert.ToString(item["EntryDate"]));
                lstgroup.Add(objGroups);
            }

            return(PartialView("_LoadGroupPartial", lstgroup));
        }
Example #36
0
        public ActionResult LikeUnlikeInstagramPost(FormCollection _FormCollection)
        {
            string LikeCount   = _FormCollection["LikeCount"];
            string IsLike      = _FormCollection["IsLike"];
            string FeedId      = _FormCollection["FeedId"];
            string InstagramId = _FormCollection["InstagramId"];

            try
            {
                Api.Groups.Groups ApiobjGroups                  = new Api.Groups.Groups();
                Domain.Socioboard.Domain.Groups objGroups       = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
                Api.Instagram.Instagram         ApiobjInstagram = new Api.Instagram.Instagram();
                string ret = ApiobjInstagram.InstagramLikeUnLike(LikeCount, IsLike, FeedId, InstagramId, objGroups.UserId.ToString());
                return(Content(ret));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
            }

            return(Content("success"));
        }
 public ActionResult DeleteGroup(string Groupid)
 {
     User objUser = (User)Session["User"];
     Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups();
     ApiobjGroups.DeleteGroupById(Groupid, objUser.Id.ToString());
     return Content("");
 }
Example #38
0
        public ActionResult AuthenticateFacebook(string op)
        {
            Session["fblogin"] = null;
            string facebookurl = "../index/index";

            if (!string.IsNullOrEmpty(op))
            {
                if (op == "fbgroup")
                {
                    Session["fblogin"] = op;
                    facebookurl        = Helper.SBUtils.GetFacebookRedirectLink();
                }
                else if (op == "page")
                {
                    int profilecount = (Int16)(Session["ProfileCount"]);
                    int totalaccount = (Int16)Session["TotalAccount"];
                    if (profilecount < totalaccount)
                    {
                        Session["fblogin"] = op;
                        facebookurl        = Helper.SBUtils.GetFacebookRedirectLink();
                    }
                    else
                    {
                    }
                }
                else if (op == "fblogin")
                {
                    Session["fblogin"] = op;
                    //if (System.Web.HttpContext.Current.Request.Url.Authority.ToLower().Equals("socioboard.com"))
                    //{
                    //    Session["fbloginredircturl"] = "http://socioboard.com/FacebookManager/Facebook";
                    //    facebookurl = "http://www.facebook.com/v2.0/dialog/oauth/?scope=user_friends,read_friendlists,publish_actions,publish_stream,read_stream,read_insights,manage_pages,user_checkins,user_photos,read_mailbox,manage_notifications,read_page_mailboxes,email,user_videos,user_groups,offline_access,publish_actions,manage_pages&client_id=" + ConfigurationManager.AppSettings["ClientId"] + "&redirect_uri=http://socioboard.com/FacebookManager/Facebook&response_type=code";
                    //}
                    //else if (System.Web.HttpContext.Current.Request.Url.Authority.ToLower().Equals("www.socioboard.com"))
                    //{
                    //    Session["fbloginredircturl"] = "http://www.socioboard.com/FacebookManager/Facebook";
                    //    facebookurl = "http://www.facebook.com/v2.0/dialog/oauth/?scope=user_friends,read_friendlists,publish_actions,publish_stream,read_stream,read_insights,manage_pages,user_checkins,user_photos,read_mailbox,manage_notifications,read_page_mailboxes,email,user_videos,user_groups,offline_access,publish_actions,manage_pages&client_id=" + ConfigurationManager.AppSettings["ClientId"] + "&redirect_uri=http://www.socioboard.com/FacebookManager/Facebook&response_type=code";
                    //}
                    //else
                    //{
                    //    facebookurl = Helper.SBUtils.GetFacebookRedirectLink();
                    //}
                    facebookurl = Helper.SBUtils.GetFacebookRedirectLink();
                    //string aksdjf =  System.Web.HttpContext.Current.Request.Url.AbsoluteUri;
                }
                else if (op == "fbplugin")
                {
                    Session["fblogin"] = op;
                    facebookurl        = Helper.SBUtils.GetFacebookRedirectLink();
                }
            }
            else
            {
                Session["addfbaccount"] = "true";
                try
                {
                    try
                    {
                        Api.Groups.Groups objApiGroups = new Api.Groups.Groups();
                        logger.Error(Session["group"]);
                        logger.Error(Session["group"].ToString());
                        JObject group = JObject.Parse(objApiGroups.GetGroupDetailsByGroupId(Session["group"].ToString().ToString()));
                        logger.Error(Session["ProfileCount"]);
                        logger.Error(Session["TotalAccount"]);
                        int profilecount = 0;
                        int totalaccount = 0;
                        try
                        {
                            profilecount = (Int16)(Session["ProfileCount"]);
                            totalaccount = (Int16)Session["TotalAccount"];
                        }
                        catch (Exception ex)
                        {
                            logger.Error("ex.Message : " + ex.Message);
                            logger.Error("ex.StackTrace : " + ex.StackTrace);
                        }

                        //if (Convert.ToString(group["GroupName"]) == ConfigurationManager.AppSettings["DefaultGroupName"].ToString())
                        //{
                        if (profilecount < totalaccount)
                        {
                            Session["fbSocial"] = "a";
                            facebookurl         = Helper.SBUtils.GetFacebookRedirectLink();
                            Response.Redirect(facebookurl);
                        }
                        else if (profilecount == 0 || totalaccount == 0)
                        {
                            Session["fbSocial"] = "a";
                            facebookurl         = Helper.SBUtils.GetFacebookRedirectLink();
                            Response.Redirect(facebookurl);
                        }
                        else
                        {
                            Response.Redirect("../Home/Index");
                        }
                        //}
                    }
                    catch (Exception ex)
                    {
                        logger.Error("ex.Message : " + ex.Message);
                        logger.Error("ex.StackTrace : " + ex.StackTrace);
                    }
                }
                catch (Exception ex)
                {
                    logger.Error(ex.Message);
                }
            }
            return(Content(facebookurl));
        }
        public ActionResult AjaxFeeds(string profileid, string load)
        {
            string datetime = Helper.Extensions.ToClientTime(DateTime.UtcNow);
            //string datetime = Request.Form["localtime"].ToString();
            ViewBag.datetime = datetime;
            List<object> lstobject = new List<object>();
            if (load == "first")
            {
                Session["FacebookProfileIdForFeeds"] = profileid;
                facebookfeedcount = 0;
            }
            else
            {
                profileid = (string)Session["FacebookProfileIdForFeeds"];
                facebookfeedcount = facebookfeedcount + 10;
            }
            Dictionary<string, List<object>> dictwallposts = new Dictionary<string, List<object>>();
            Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups();
            Domain.Socioboard.Domain.Groups objGroups = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
            Api.FacebookFeed.FacebookFeed ApiobjFacebookFeed = new Api.FacebookFeed.FacebookFeed();
            List<MongoFacebookFeed> lstFacebookFeed = (List<MongoFacebookFeed>)(new JavaScriptSerializer().Deserialize(ApiobjFacebookFeed.getAllFacebookFeedsByUserIdAndProfileId1(objGroups.UserId.ToString(), profileid, facebookfeedcount), typeof(List<MongoFacebookFeed>)));
            foreach (var twittermsg in lstFacebookFeed)
            {
                lstobject.Add(twittermsg);
            }
            dictwallposts.Add("facebook", lstobject);
            if (lstFacebookFeed.Count > 0)
            {
                return PartialView("_Panel2Partial", dictwallposts);
            }
            else
            {
                return Content("no_data");
            }

        }
        public ActionResult AuthenticateYoutube(string op)
        {
            string googleurl = string.Empty;
            if (!string.IsNullOrEmpty(op))
            {
                if (op == "googlepluslogin")
                {
                    Session["googlepluslogin"] = op;
                    googleurl = "https://accounts.google.com/o/oauth2/auth?client_id=" + ConfigurationManager.AppSettings["YtconsumerKey"] + "&redirect_uri=" + ConfigurationManager.AppSettings["Ytredirect_uri"] + "&scope=https://www.googleapis.com/auth/youtube+https://www.googleapis.com/auth/youtube.readonly+https://www.googleapis.com/auth/youtubepartner+https://www.googleapis.com/auth/youtubepartner-channel-audit+https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/userinfo.profile+https://www.googleapis.com/auth/plus.me&response_type=code&access_type=offline";
                }
                else if (op == "gplus")
                {
                    Session["googlepluslogin"] = op;
                    try
                    {
                        try
                        {
                            Api.Groups.Groups objApiGroups = new Api.Groups.Groups();
                            JObject group = JObject.Parse(objApiGroups.GetGroupDetailsByGroupId(Session["group"].ToString().ToString()));
                            int profilecount = 0;
                            int totalaccount = 0;
                            try
                            {
                                profilecount = (Int16)(Session["ProfileCount"]);
                                totalaccount = (Int16)Session["TotalAccount"];
                            }
                            catch (Exception ex)
                            {
                                logger.Error("ex.Message : " + ex.Message);
                                logger.Error("ex.StackTrace : " + ex.StackTrace);
                            }
                            {
                                if (profilecount < totalaccount)
                                {
                                    Response.Redirect("https://accounts.google.com/o/oauth2/auth?client_id=" + ConfigurationManager.AppSettings["YtconsumerKey"] + "&redirect_uri=" + ConfigurationManager.AppSettings["Ytredirect_uri"] + "&scope=https://www.googleapis.com/auth/plus.login+https://www.googleapis.com/auth/plus.profile.emails.read+https://www.googleapis.com/auth/plus.stream.write+https://www.googleapis.com/auth/plus.stream.read+https://www.googleapis.com/auth/plus.circles.read+https://www.googleapis.com/auth/plus.circles.write+https://www.googleapis.com/auth/plus.profiles.read+https://www.googleapis.com/auth/plus.media.upload+https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/userinfo.profile+https://www.googleapis.com/auth/plus.me&response_type=code&access_type=offline");
                                }
                                else if (profilecount == 0 || totalaccount == 0)
                                {
                                    Response.Redirect("https://accounts.google.com/o/oauth2/auth?client_id=" + ConfigurationManager.AppSettings["YtconsumerKey"] + "&redirect_uri=" + ConfigurationManager.AppSettings["Ytredirect_uri"] + "&scope=https://www.googleapis.com/auth/plus.login+https://www.googleapis.com/auth/plus.profile.emails.read+https://www.googleapis.com/auth/plus.stream.write+https://www.googleapis.com/auth/plus.stream.read+https://www.googleapis.com/auth/plus.circles.read+https://www.googleapis.com/auth/plus.circles.write+https://www.googleapis.com/auth/plus.profiles.read+https://www.googleapis.com/auth/plus.media.upload+https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/userinfo.profile+https://www.googleapis.com/auth/plus.me&response_type=code&access_type=offline");
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                            return RedirectToAction("Index", "Home");
                        }
                    }
                    catch (Exception ex)
                    {
                        return RedirectToAction("Index", "Home");
                    }
                }

            }

            else
            {
                try
                {
                    try
                    {
                        Api.Groups.Groups objApiGroups = new Api.Groups.Groups();
                        JObject group = JObject.Parse(objApiGroups.GetGroupDetailsByGroupId(Session["group"].ToString().ToString()));
                        int profilecount = 0;
                        int totalaccount = 0;
                        try
                        {
                            profilecount = (Int16)(Session["ProfileCount"]);
                            totalaccount = (Int16)Session["TotalAccount"];
                        }
                        catch (Exception ex)
                        {
                            logger.Error("ex.Message : " + ex.Message);
                            logger.Error("ex.StackTrace : " + ex.StackTrace);
                        }
                        {
                            if (profilecount < totalaccount)
                            {
                                //string redirect = "https://accounts.google.com/o/oauth2/auth?client_id=" + ConfigurationManager.AppSettings["YtconsumerKey"] + "&redirect_uri=" + ConfigurationManager.AppSettings["Ytredirect_uri"] + "&scope=https://www.googleapis.com/auth/youtube+https://www.googleapis.com/auth/youtube.readonly+https://www.googleapis.com/auth/youtubepartner+https://www.googleapis.com/auth/youtubepartner-channel-audit+https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/userinfo.profile+https://www.googleapis.com/auth/plus.me&response_type=code&access_type=offline";
                                Response.Redirect("https://accounts.google.com/o/oauth2/auth?client_id=" + ConfigurationManager.AppSettings["YtconsumerKey"] + "&redirect_uri=" + ConfigurationManager.AppSettings["Ytredirect_uri"] + "&scope=https://www.googleapis.com/auth/youtube+https://www.googleapis.com/auth/youtube.readonly+https://www.googleapis.com/auth/youtubepartner+https://www.googleapis.com/auth/youtubepartner-channel-audit+https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/userinfo.profile+https://www.googleapis.com/auth/plus.me&response_type=code&access_type=offline");
                            }
                            else if (profilecount == 0 || totalaccount == 0)
                            {
                                Response.Redirect("https://accounts.google.com/o/oauth2/auth?client_id=" + ConfigurationManager.AppSettings["YtconsumerKey"] + "&redirect_uri=" + ConfigurationManager.AppSettings["Ytredirect_uri"] + "&scope=https://www.googleapis.com/auth/youtube+https://www.googleapis.com/auth/youtube.readonly+https://www.googleapis.com/auth/youtubepartner+https://www.googleapis.com/auth/youtubepartner-channel-audit+https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/userinfo.profile+https://www.googleapis.com/auth/plus.me&response_type=code&access_type=offline");
                            }
                            else
                            {
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                    }
                }
                catch (Exception ex)
                {
                }
            }
            return Content(googleurl);
        }
        //Edited by Sumit Gupta
        public ActionResult scheduler(string network, string profileid)
        {
            List<ScheduledMessage> objScheduledMessage = new List<ScheduledMessage>();
            //Dictionary<object, List<ScheduledMessage>> dictscheduler = new Dictionary<object, List<ScheduledMessage>>();
            Dictionary<string, List<object>> dictscheduler = new Dictionary<string, List<object>>();
            Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups();
            Domain.Socioboard.Domain.Groups objGroups = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
            if (network == "facebook")
            {
                Api.FacebookAccount.FacebookAccount ApiobjFacebookAccount = new Api.FacebookAccount.FacebookAccount();
                FacebookAccount objFacebookAccount = (FacebookAccount)(new JavaScriptSerializer().Deserialize(ApiobjFacebookAccount.getFacebookAccountDetailsById(objGroups.UserId.ToString(), profileid.ToString()), typeof(FacebookAccount)));
                Api.ScheduledMessage.ScheduledMessage ApiobjScheduledMessage = new Api.ScheduledMessage.ScheduledMessage();
                objScheduledMessage = (List<ScheduledMessage>)(new JavaScriptSerializer().Deserialize(ApiobjScheduledMessage.GetAllUnSentMessagesAccordingToGroup(objGroups.UserId.ToString(), profileid.ToString(), network), typeof(List<ScheduledMessage>)));
                //dictscheduler.Add(objFacebookAccount, objScheduledMessage);
            }
            else if (network == "twitter")
            {
                Api.TwitterAccount.TwitterAccount ApiobjTwitterAccount = new Api.TwitterAccount.TwitterAccount();
                TwitterAccount objTwitterAccount = (TwitterAccount)(new JavaScriptSerializer().Deserialize(ApiobjTwitterAccount.GetTwitterAccountDetailsById(objGroups.UserId.ToString(), profileid.ToString()), typeof(TwitterAccount)));
                Api.ScheduledMessage.ScheduledMessage ApiobjScheduledMessage = new Api.ScheduledMessage.ScheduledMessage();
                objScheduledMessage = (List<ScheduledMessage>)(new JavaScriptSerializer().Deserialize(ApiobjScheduledMessage.GetAllUnSentMessagesAccordingToGroup(objGroups.UserId.ToString(), profileid.ToString(), network), typeof(List<ScheduledMessage>)));
                //dictscheduler.Add(objTwitterAccount, objScheduledMessage);
            }
            else if (network == "linkedin")
            {
                Api.LinkedinAccount.LinkedinAccount ApiobjLinkedinAccount = new Api.LinkedinAccount.LinkedinAccount();
                LinkedInAccount objLinkedInAccount = (LinkedInAccount)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinAccount.GetLinkedinAccountDetailsById(objGroups.UserId.ToString(), profileid.ToString()), typeof(LinkedInAccount)));
                Api.ScheduledMessage.ScheduledMessage ApiobjScheduledMessage = new Api.ScheduledMessage.ScheduledMessage();
                objScheduledMessage = (List<ScheduledMessage>)(new JavaScriptSerializer().Deserialize(ApiobjScheduledMessage.GetAllUnSentMessagesAccordingToGroup(objGroups.UserId.ToString(), profileid.ToString(), network), typeof(List<ScheduledMessage>)));
                //dictscheduler.Add(objLinkedInAccount, objScheduledMessage);
            }

            List<object> lstObject = new List<object>();
            foreach (var item in objScheduledMessage)
            {
                lstObject.Add(item);
            }

            dictscheduler.Add(network, lstObject);

            return PartialView("_Panel3Partial", dictscheduler);
        }
Example #42
0
        public ActionResult LoadGroup()
        {
            User objUser = (User)Session["User"];
            Api.Groups.Groups objApiGroups = new Api.Groups.Groups();
            objApiGroups.Timeout = 300000;
            JArray profile = JArray.Parse(objApiGroups.GetGroupDetailsByUserId(objUser.Id.ToString()));

            List<Groups> lstgroup = new List<Groups>();
            foreach (var item in profile)
            {
                Groups objGroups = new Groups();
                objGroups.Id = Guid.Parse(Convert.ToString(item["Id"]));
                objGroups.GroupName = Convert.ToString(item["GroupName"]);
                objGroups.UserId = Guid.Parse(Convert.ToString(item["UserId"]));
                objGroups.EntryDate = Convert.ToDateTime(Convert.ToString(item["EntryDate"]));
                lstgroup.Add(objGroups);
            }

            return PartialView("_LoadGroupPartial", lstgroup);

        }
        public ActionResult AuthenticateTwitter(string op)
        {
            logger.Error("Abhay twittermanager");
            try
            {
                try
                {
                    if (op != null)
                    {
                        if (op == "twitterlogin")
                        {
                            Session["twitterlogin"] = op;
                            Api.Twitter.Twitter apiobjTwitter = new Api.Twitter.Twitter();
                            string TwitterUrl = apiobjTwitter.GetTwitterRedirectUrl(ConfigurationManager.AppSettings["consumerKey"], ConfigurationManager.AppSettings["consumerSecret"], ConfigurationManager.AppSettings["callbackurl"]);
                            string str = TwitterUrl.Split('~')[0].ToString();
                            Session["requestSecret"] = TwitterUrl.Split('~')[1].ToString();
                            //Response.Redirect(TwitterUrl.Split('~')[0].ToString(), true);
                            return Content(TwitterUrl.Split('~')[0].ToString());
                        }
                    }
                    else
                    {
                        Api.Groups.Groups objApiGroups = new Api.Groups.Groups();
                        JObject group = null;

                        try
                        {
                            logger.Error("GetGroupDetailsByGroupId before");
                            group = JObject.Parse(objApiGroups.GetGroupDetailsByGroupId(Session["group"].ToString()));
                            logger.Error("GetGroupDetailsByGroupId after");
                        }
                        catch (Exception ex)
                        {
                            logger.Error("GetGroupDetailsByGroupId Exception");
                            logger.Error(ex.Message);
                            logger.Error(ex.StackTrace);
                        }

                      
                        if (Convert.ToString(group["GroupName"]) == ConfigurationManager.AppSettings["DefaultGroupName"].ToString())
                        {
                           
                                Api.Twitter.Twitter apiobjTwitter = new Api.Twitter.Twitter();
                                string TwitterUrl = apiobjTwitter.GetTwitterRedirectUrl(ConfigurationManager.AppSettings["consumerKey"], ConfigurationManager.AppSettings["consumerSecret"], ConfigurationManager.AppSettings["callbackurl"]);
                                string str = TwitterUrl.Split('~')[0].ToString();
                                Session["requestSecret"] = TwitterUrl.Split('~')[1].ToString();
                                Response.Redirect(TwitterUrl.Split('~')[0].ToString());
                            
                        }
                    }
                }
                catch (Exception ex)
                {
                    logger.Error(ex.Message);
                    logger.Error(ex.StackTrace);
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex.Message);
                logger.Error(ex.StackTrace);
            }
            //return View();
            return RedirectToAction("SocialMedia", "Home");
        }
        //[OutputCache(Duration = 45, Location = OutputCacheLocation.Client, NoStore = true)]
        public ActionResult AddLoadNewFacebookWallPosts(string profileid, string type)
        {
            string datetime = Helper.Extensions.ToClientTime(DateTime.UtcNow);
            //string datetime = Request.Form["localtime"].ToString();
            ViewBag.datetime = datetime;
            bool isUserFeedsCalled = false;
            if (type != null)
            {
                if (type.Equals("userfeeds") && !string.IsNullOrEmpty(type))
                {
                    isUserFeedsCalled = true;
                }
            }

            Dictionary<string, List<object>> dictwallposts = new Dictionary<string, List<object>>();

            Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups();
            Domain.Socioboard.Domain.Groups objGroups = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
            Api.Facebook.Facebook ApiobjFacebook = new Api.Facebook.Facebook();
            List<Domain.Socioboard.MongoDomain.FacebookMessage> lstFacebookMessage;
            try
            {
                lstFacebookMessage = (List<Domain.Socioboard.MongoDomain.FacebookMessage>)(new JavaScriptSerializer().Deserialize(ApiobjFacebook.AddNewFacebookWallPosts(profileid, objGroups.UserId.ToString()), typeof(List<Domain.Socioboard.MongoDomain.FacebookMessage>)));
            }
            catch (Exception ex)
            {
                lstFacebookMessage = new List<Domain.Socioboard.MongoDomain.FacebookMessage>();
            }
            List<object> lstobject = new List<object>();
            foreach (var item in lstFacebookMessage)
            {
                //if (isUserFeedsCalled)
                //{
                //    if (item.FromId != item.ProfileId)
                //    {
                //        lstobject.Add(item);
                //    }
                //}
                //else
                //{
                lstobject.Add(item);
                //}
            }

            dictwallposts.Add("facebook", lstobject);

            //if (isUserFeedsCalled)
            //{
            //     return PartialView("_Panel3Partial", dictwallposts);
            //}
            //else
            //{
            return PartialView("_Panel1Partial", dictwallposts);
            //}

        }
        public ActionResult AuthenticateFacebook(string op)
        {
            Session["fblogin"] = null;
            string facebookurl = "../index/index";
            if (!string.IsNullOrEmpty(op))
            {

                if (op == "fbgroup")
                {
                    Session["fblogin"] = op;
                    facebookurl = Helper.SBUtils.GetFacebookRedirectLink();
                }
                else if (op == "page")
                {
                    int profilecount = (Int16)(Session["ProfileCount"]);
                    int totalaccount = (Int16)Session["TotalAccount"];
                    if (profilecount < totalaccount)
                    {
                        Session["fblogin"] = op;
                        facebookurl = Helper.SBUtils.GetFacebookRedirectLink();
                    }
                    else { }
                }
                else if (op == "fblogin")
                {
                    Session["fblogin"] = op;
                    //if (System.Web.HttpContext.Current.Request.Url.Authority.ToLower().Equals("socioboard.com")) 
                    //{
                    //    Session["fbloginredircturl"] = "http://socioboard.com/FacebookManager/Facebook";
                    //    facebookurl = "http://www.facebook.com/v2.0/dialog/oauth/?scope=user_friends,read_friendlists,publish_actions,publish_stream,read_stream,read_insights,manage_pages,user_checkins,user_photos,read_mailbox,manage_notifications,read_page_mailboxes,email,user_videos,user_groups,offline_access,publish_actions,manage_pages&client_id=" + ConfigurationManager.AppSettings["ClientId"] + "&redirect_uri=http://socioboard.com/FacebookManager/Facebook&response_type=code";
                    //}
                    //else if (System.Web.HttpContext.Current.Request.Url.Authority.ToLower().Equals("www.socioboard.com"))
                    //{
                    //    Session["fbloginredircturl"] = "http://www.socioboard.com/FacebookManager/Facebook";
                    //    facebookurl = "http://www.facebook.com/v2.0/dialog/oauth/?scope=user_friends,read_friendlists,publish_actions,publish_stream,read_stream,read_insights,manage_pages,user_checkins,user_photos,read_mailbox,manage_notifications,read_page_mailboxes,email,user_videos,user_groups,offline_access,publish_actions,manage_pages&client_id=" + ConfigurationManager.AppSettings["ClientId"] + "&redirect_uri=http://www.socioboard.com/FacebookManager/Facebook&response_type=code";
                    //}
                    //else 
                    //{
                    //    facebookurl = Helper.SBUtils.GetFacebookRedirectLink();
                    //}
                    facebookurl = Helper.SBUtils.GetFacebookRedirectLink();
                    //string aksdjf =  System.Web.HttpContext.Current.Request.Url.AbsoluteUri;

                }
            }
            else
            {
                Session["addfbaccount"] = "true";
                try
                {
                    try
                    {
                        Api.Groups.Groups objApiGroups = new Api.Groups.Groups();
                        logger.Error(Session["group"]);
                        logger.Error(Session["group"].ToString());
                        JObject group = JObject.Parse(objApiGroups.GetGroupDetailsByGroupId(Session["group"].ToString().ToString()));
                        logger.Error(Session["ProfileCount"]);
                        logger.Error(Session["TotalAccount"]);
                        int profilecount = 0;
                        int totalaccount = 0;
                        try
                        {
                            profilecount = (Int16)(Session["ProfileCount"]);
                            totalaccount = (Int16)Session["TotalAccount"];
                        }
                        catch (Exception ex)
                        {
                            logger.Error("ex.Message : " + ex.Message);
                            logger.Error("ex.StackTrace : " + ex.StackTrace);
                        }

                        if (Convert.ToString(group["GroupName"]) == ConfigurationManager.AppSettings["DefaultGroupName"].ToString())
                        {
                            if (profilecount < totalaccount)
                            {
                                Session["fbSocial"] = "a";
                                facebookurl = Helper.SBUtils.GetFacebookRedirectLink();
                                Response.Redirect(facebookurl);
                            }
                            else if (profilecount == 0 || totalaccount == 0)
                            {
                                Session["fbSocial"] = "a";
                                facebookurl = Helper.SBUtils.GetFacebookRedirectLink();
                                Response.Redirect(facebookurl);
                            }
                            else
                            {
                                Response.Redirect("../Home/Index");
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        logger.Error("ex.Message : " + ex.Message);
                        logger.Error("ex.StackTrace : " + ex.StackTrace);
                    }
                }
                catch (Exception ex)
                {
                    logger.Error(ex.Message);
                }
            }
            return Content(facebookurl);
        }
        public ActionResult ShowInstagramFeeds(string load, string id)
        {

            if (load == "first")
            {
                Session["InsragramIdForFeeds"] = id;
                instagramfeedcount = 0;
            }
            else
            {
                id = (string)Session["InsragramIdForFeeds"];
                instagramfeedcount = instagramfeedcount + 8;
            }

            object lstobject = new object();
            List<object> lstComment = null;
            Domain.Socioboard.Domain.User _User = (Domain.Socioboard.Domain.User)Session["User"];
            Dictionary<string, Dictionary<object, List<object>>> dictwallposts = new Dictionary<string, Dictionary<object, List<object>>>();
            Dictionary<object, List<object>> dic_InstgramImg = new Dictionary<object, List<object>>();
            Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups();
            Domain.Socioboard.Domain.Groups objGroups = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
            Api.InstagramFeed.InstagramFeed ApiobjInstagramFeed = new Api.InstagramFeed.InstagramFeed();
            Api.InstagramComment.InstagramComment ApiobjInstagramFeedComment = new Api.InstagramComment.InstagramComment();


            List<Domain.Socioboard.MongoDomain.InstagramFeed> lstInstagramFeed = (List<Domain.Socioboard.MongoDomain.InstagramFeed>)(new JavaScriptSerializer().Deserialize(ApiobjInstagramFeed.GetFeedsOfProfileWithRange(objGroups.UserId.ToString(), id, instagramfeedcount.ToString(), "8"), typeof(List<Domain.Socioboard.MongoDomain.InstagramFeed>)));
            foreach (var item_lstInstagramfeed in lstInstagramFeed)
            {
                lstComment = new List<object>();
                List<Domain.Socioboard.MongoDomain.InstagramComment> lstInstagramComment = (List<Domain.Socioboard.MongoDomain.InstagramComment>)(new JavaScriptSerializer().Deserialize(ApiobjInstagramFeedComment.GetInstagramFeedsComment(objGroups.UserId.ToString(), item_lstInstagramfeed.FeedId.ToString()), typeof(List<Domain.Socioboard.MongoDomain.InstagramComment>)));
                foreach (var item in lstInstagramComment)
                {
                    lstComment.Add(item);
                }
                lstobject = (object)item_lstInstagramfeed;
                dic_InstgramImg.Add(lstobject, lstComment);
            }
            dictwallposts.Add("instagram", dic_InstgramImg);
            return PartialView("_InstagramPartial", dictwallposts);
        }
        public ActionResult LinkedinFeeds(string profileid, string load)
        {
            string datetime = Helper.Extensions.ToClientTime(DateTime.UtcNow);
            //string datetime = Request.Form["localtime"].ToString();
            ViewBag.datetime = datetime;
            if (load == "first")
            {
                Session["LinkedInProfileIdForFeeds"] = profileid;
                linkedinfeedcount = 0;
            }
            else
            {
                profileid = (string)Session["LinkedInProfileIdForFeeds"];
                linkedinfeedcount = linkedinfeedcount + 10;
            }
            List<object> lstobject = new List<object>();
            Dictionary<string, List<object>> dictwallposts = new Dictionary<string, List<object>>();
            Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups();
            Domain.Socioboard.Domain.Groups objGroups = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
            //Api.Linkedin.Linkedin ApiobjLinkedin = new Api.Linkedin.Linkedin();
            //List<Domain.Socioboard.Domain.LinkedInUser.User_Updates> lstlinkedinFeeds = (List<Domain.Socioboard.Domain.LinkedInUser.User_Updates>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedin.GetLinkedUserUpdates(profileid, objGroups.UserId.ToString()), typeof(List<Domain.Socioboard.Domain.LinkedInUser.User_Updates>)));

            Api.LinkedinMessage.LinkedinMessage ApiobjLinkedinMessage = new Api.LinkedinMessage.LinkedinMessage();
            List<Domain.Socioboard.MongoDomain.LinkedInMessage> lstLinkedInMessage = (List<Domain.Socioboard.MongoDomain.LinkedInMessage>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinMessage.GetLinkedInMessages(objGroups.UserId.ToString(), profileid, linkedinfeedcount), typeof(List<Domain.Socioboard.MongoDomain.LinkedInMessage>)));

            foreach (var linkledinfeed in lstLinkedInMessage)
            {
                lstobject.Add(linkledinfeed);
            }
            dictwallposts.Add("linkedin", lstobject);
            if (lstLinkedInMessage.Count > 0)
            {
                return PartialView("_Panel2Partial", dictwallposts);
            }
            else
            {
                return Content("no_data");
            }

        }
        public ActionResult TwitterFeeds(string profileid, string load)
        {
            string datetime = Helper.Extensions.ToClientTime(DateTime.UtcNow);
            //string datetime = Request.Form["localtime"].ToString();
            ViewBag.datetime = datetime;
            List<object> lstobject = new List<object>();
            if (load == "first")
            {
                Session["TwitterProfileIdForFeeds"] = profileid;
                twtfeedcount = 0;
            }
            else
            {
                profileid = (string)Session["TwitterProfileIdForFeeds"];
                twtfeedcount = twtfeedcount + 10;
            }

            Dictionary<string, List<object>> dictwallposts = new Dictionary<string, List<object>>();
            Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups();
            Domain.Socioboard.Domain.Groups objGroups = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
            Api.TwitterMessage.TwitterMessage ApiobjTwitterMessage = new Api.TwitterMessage.TwitterMessage();
            List<Domain.Socioboard.MongoDomain.TwitterMessage> lstTwitterMessage = (List<Domain.Socioboard.MongoDomain.TwitterMessage>)(new JavaScriptSerializer().Deserialize(ApiobjTwitterMessage.GetTwitterMessages1(profileid, objGroups.UserId.ToString(), twtfeedcount), typeof(List<Domain.Socioboard.MongoDomain.TwitterMessage>)));
            foreach (var twittermsg in lstTwitterMessage)
            {
                lstobject.Add(twittermsg);
            }
            dictwallposts.Add("twitter", lstobject);
            if (lstTwitterMessage.Count > 0)
            {
                return PartialView("_Panel2Partial", dictwallposts);
            }
            else
            {
                return Content("no_data");
            }
        }
 public ActionResult FacebookLike(string fbid, string profileid, string msgid)
 {
     Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups();
     Domain.Socioboard.Domain.Groups objGroups = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
     Api.Facebook.Facebook ApiobjFacebook = new Api.Facebook.Facebook();
     string ret = ApiobjFacebook.FacebookLike(msgid, profileid, fbid, objGroups.UserId.ToString());
     return Content(ret);
 }
        //Added by Sumit Gupta[15-02-2015]
        //[OutputCache(Duration = 45, Location = OutputCacheLocation.Client, NoStore = true)]
        public ActionResult AddLoadNewFacebookNewsFeeds(string profileid)
        {
            string datetime = Helper.Extensions.ToClientTime(DateTime.UtcNow);
            //string datetime = Request.Form["localtime"].ToString();
            ViewBag.datetime = datetime;
            List<object> lstobject = new List<object>();
            Dictionary<string, List<object>> dictFeeds = new Dictionary<string, List<object>>();

            Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups();
            Dictionary<string, List<object>> dictwallposts = new Dictionary<string, List<object>>();
            Domain.Socioboard.Domain.Groups objGroups = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
            Api.FacebookFeed.FacebookFeed ApiobjFacebookFeed = new Api.FacebookFeed.FacebookFeed();

            Api.Facebook.Facebook ApiobjFacebook = new Api.Facebook.Facebook();

            List<MongoFacebookFeed> lstFacebookFeed = new List<MongoFacebookFeed>();

            try
            {
                lstFacebookFeed = (List<MongoFacebookFeed>)(new JavaScriptSerializer().Deserialize(ApiobjFacebook.AddNewFacebookFeeds(profileid, objGroups.UserId.ToString()), typeof(List<MongoFacebookFeed>)));
            }
            catch (Exception ex)
            {
                lstFacebookFeed = null;
            }
            if (lstFacebookFeed == null)
            {
                lstFacebookFeed = new List<MongoFacebookFeed>();
            }
            foreach (var FacebookFeed in lstFacebookFeed)
            {
                lstobject.Add(FacebookFeed);
            }
            dictwallposts.Add("facebook", lstobject);

            return PartialView("_Panel2Partial", dictwallposts);
        }
 public ActionResult AuthenticateTwitter()
 {
     try
     {
         try
         {
             Api.Groups.Groups objApiGroups = new Api.Groups.Groups();
             JObject group = JObject.Parse(objApiGroups.GetGroupDetailsByGroupId(Session["group"].ToString().ToString()));
             int profilecount = (Int16)(Session["ProfileCount"]);
             int totalaccount = (Int16)Session["TotalAccount"];
             if (Convert.ToString(group["GroupName"]) == ConfigurationManager.AppSettings["DefaultGroupName"].ToString())
             {
                 if (profilecount < totalaccount)
                 {
                     Api.Twitter.Twitter apiobjTwitter = new Api.Twitter.Twitter();
                     string TwitterUrl = apiobjTwitter.GetTwitterRedirectUrl(ConfigurationManager.AppSettings["consumerKey"], ConfigurationManager.AppSettings["consumerSecret"], ConfigurationManager.AppSettings["callbackurl"]);
                     string str = TwitterUrl.Split('~')[0].ToString();
                     Session["requestSecret"] = TwitterUrl.Split('~')[1].ToString();
                     Response.Redirect(TwitterUrl.Split('~')[0].ToString());
                 }
                 else
                 {
                 }
             }
         }
         catch (Exception ex)
         {
         }
     }
     catch (Exception ex)
     {
     }
     return View();
 }
        public ActionResult FacebookTag(string ProfileId)
        {
            List<object> lstobject = new List<object>();
            Dictionary<string, List<object>> dictTag = new Dictionary<string, List<object>>();
            Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups();
            Domain.Socioboard.Domain.Groups objGroups = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));

            Api.FacebookMessage.FacebookMessage ApiobjFacebookMessage = new Api.FacebookMessage.FacebookMessage();
            List<Domain.Socioboard.MongoDomain.FacebookMessage> lstFacebookTag = (List<Domain.Socioboard.MongoDomain.FacebookMessage>)(new JavaScriptSerializer().Deserialize(ApiobjFacebookMessage.getAllFacebookTagOfUsers(objGroups.UserId.ToString(), ProfileId), typeof(List<Domain.Socioboard.MongoDomain.FacebookMessage>)));
            foreach (var FacebookTag in lstFacebookTag)
            {
                lstobject.Add(FacebookTag);
            }
            dictTag.Add("facebook", lstobject);
            return PartialView("_Panel3Partial", dictTag);
        }
        public ActionResult Signup()
        {
            logger.Error("Register");
            User _user = (User)Session["User"];
            Domain.Socioboard.Domain.User user = new Domain.Socioboard.Domain.User();
            Session["AjaxLogin"] = "******";
            string retmsg = string.Empty;
            try
            {
                System.IO.StreamReader sr = new System.IO.StreamReader(Request.InputStream);
                string line = "";
                line = sr.ReadToEnd();
                JObject jo = JObject.Parse(line);
                user.PaymentStatus = "unpaid";

                user.AccountType = Server.UrlDecode((string)jo["package"]);
                user.CreateDate = DateTime.Now;
                user.ExpiryDate = DateTime.Now.AddDays(30);
                user.Id = Guid.NewGuid();
                user.UserName = Server.UrlDecode((string)jo["firstname"]) + " " + Server.UrlDecode((string)jo["lastname"]);
                user.EmailId = Server.UrlDecode((string)jo["email"]);
                user.Password = Server.UrlDecode((string)jo["password"]);
                user.UserStatus = 1;
                if (_user != null)
                {
                    if (_user.ActivationStatus == "1") //If Login from Facebook, then ActivationStatus would be 1, refer to FacebookManager Controller
                    {
                        user.ActivationStatus = "1";
                        user.SocialLogin = _user.SocialLogin;
                        user.ProfileUrl = _user.ProfileUrl;
                    }
                    else
                    {
                        user.ActivationStatus = "0";
                    }
                }
                else
                {
                    user.ActivationStatus = "0";
                }
                string firstName = Server.UrlDecode((string)jo["firstname"]);
                string lastName = Server.UrlDecode((string)jo["lastname"]);
                Api.User.User objApiUser = new Api.User.User();
                //string res_Registration = objApiUser.Register(user.EmailId, user.Password, user.AccountType, user.UserName, user.ActivationStatus);
                string res_Registration = string.Empty;
                if (Session["twitterlogin"] != null)
                {
                    if ((string)Session["twitterlogin"] == "twitterlogin")
                    {
                        res_Registration = objApiUser.RegisterbyTwitter(user.EmailId, user.Password, user.AccountType, user.UserName, user.SocialLogin, user.ProfileUrl, user.ActivationStatus);
                    }
                    else
                    {
                        res_Registration = objApiUser.Register(user.EmailId, user.Password, user.AccountType, user.UserName, user.ActivationStatus);
                    }
                }
                else
                {
                    res_Registration = objApiUser.Register(user.EmailId, user.Password, user.AccountType, user.UserName, user.ActivationStatus);
                }
                logger.Error("res_Registration: " + res_Registration);
                if (res_Registration != "Email Already Exists")
                {
                    if (user != null)
                    {
                        Api.User.User obj = new Api.User.User();
                        user = (User)(new JavaScriptSerializer().Deserialize(obj.Login(user.EmailId, user.Password), typeof(User)));
                        Session["User"] = user;
                        if (Session["fblogin"] != null)
                        {
                            string accesstoken = (string)Session["AccesstokenFblogin"];
                            Api.Facebook.Facebook objfacebook = new Api.Facebook.Facebook();
                            Api.Groups.Groups objgroup = new Api.Groups.Groups();
                            //Domain.Socioboard.Domain.Groups group = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(objgroup.GetGroupDetailsByUserId(user.Id.ToString()), typeof(Domain.Socioboard.Domain.Groups)));
                            Groups obpgrp = (Groups)(new JavaScriptSerializer().Deserialize(objgroup.GetGroupDeUserId(user.Id.ToString()), typeof(Groups)));
                            objfacebook.AddFacebookAccountWithloginAsync(accesstoken, user.Id.ToString(), obpgrp.Id.ToString());
                        }
                        if (Session["googlepluslogin"] != null)
                        {
                            string accesstoken = (string)Session["AccesstokenFblogin"];
                            Api.Youtube.Youtube objYoutube = new Api.Youtube.Youtube();
                            Api.Groups.Groups objgroup = new Api.Groups.Groups();
                            //Domain.Socioboard.Domain.Groups group = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(objgroup.GetGroupDetailsByUserId(user.Id.ToString()), typeof(Domain.Socioboard.Domain.Groups)));
                            Groups grp = (Groups)(new JavaScriptSerializer().Deserialize(objgroup.GetGroupDeUserId(user.Id.ToString()), typeof(Groups)));
                            objYoutube.AddYoutubeAccountwithLoginAsync(ConfigurationManager.AppSettings["YtconsumerKey"], ConfigurationManager.AppSettings["YtconsumerSecret"], ConfigurationManager.AppSettings["Ytredirect_uri"], user.Id.ToString(), grp.Id.ToString(), accesstoken);
                        }
                        retmsg = "user";
                    }

                    //Domain.Socioboard.Domain.Invitation _Invitation = (Domain.Socioboard.Domain.Invitation)Session["InvitationInfo"];
                    Api.Invitation.Invitation ApiInvitation = new Api.Invitation.Invitation();
                    if (Session["InvitationCode"] != null)
                    {
                        string invitationcode = Session["InvitationCode"].ToString();
                        ApiInvitation.AddInvitationInfoBycode(invitationcode, user.EmailId, user.Id.ToString());
                    }

                    //if (_Invitation != null)
                    //{
                    //    if (user.EmailId == _Invitation.FriendEmail)
                    //    {
                    //        string ret = ApiInvitation.UpdateInvitatoinStatus(_Invitation.Id.ToString(), user.Id.ToString());
                    //    }
                    //}

                }
                else
                {
                    retmsg = "Email Already Exists";
                }
                //return Content(retmsg);
                Session.Abandon();
                Session.Clear();
                Session.RemoveAll();
            }
            catch (Exception ex)
            {
                //logger.Error(ex.StackTrace);
                Console.WriteLine(ex.StackTrace);
            }
            //return View("_RegistrationPartial");



            return Content(retmsg);
        }
 //[OutputCache(Duration = 45, Location = OutputCacheLocation.Client, NoStore = true)]
 public ActionResult wallposts_FeedsSearch(string op, string load, string profileid, string keyword)
 {
     string datetime = Helper.Extensions.ToClientTime(DateTime.UtcNow);
     //string datetime = Request.Form["localtime"].ToString();
     ViewBag.datetime = datetime;
     Dictionary<string, List<object>> dictwallposts = new Dictionary<string, List<object>>();
     if (load == "first")
     {
         Session["FacebookProfileIdForFeeds"] = profileid;
         facebookwallcount = 0;
     }
     else
     {
         profileid = (string)Session["FacebookProfileIdForFeeds"];
         facebookwallcount = facebookwallcount + 10;
     }
     Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups();
     Domain.Socioboard.Domain.Groups objGroups = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
     Api.FacebookMessage.FacebookMessage ApiobjFacebookMessage = new Api.FacebookMessage.FacebookMessage();
     List<Domain.Socioboard.MongoDomain.FacebookMessage> lstFacebookMessage = new List<Domain.Socioboard.MongoDomain.FacebookMessage>();
     lstFacebookMessage = (List<Domain.Socioboard.MongoDomain.FacebookMessage>)(new JavaScriptSerializer().Deserialize(ApiobjFacebookMessage.GetAllWallpostsOfProfileAccordingtoGroupByUserIdAndProfileId1WithRange(objGroups.UserId.ToString(), keyword, profileid, facebookwallcount.ToString()), typeof(List<Domain.Socioboard.MongoDomain.FacebookMessage>)));
     if (lstFacebookMessage == null)
     {
         lstFacebookMessage = new List<Domain.Socioboard.MongoDomain.FacebookMessage>();
     }
     List<object> lstobject = new List<object>();
     foreach (var item in lstFacebookMessage)
     {
         lstobject.Add(item);
     }
     dictwallposts.Add("facebook", lstobject);
     return PartialView("_Panel1Partial", dictwallposts);
 }
 public ActionResult AuthenticateInstagram()
 {
     try
     {
         try
         {
             Api.Groups.Groups objApiGroups = new Api.Groups.Groups();
             JObject group = JObject.Parse(objApiGroups.GetGroupDetailsByGroupId(Session["group"].ToString().ToString()));
             int profilecount = 0;
             int totalaccount = 0;
             try
             {
                 profilecount = (Int16)(Session["ProfileCount"]);
                 totalaccount = (Int16)Session["TotalAccount"];
             }
             catch (Exception ex)
             {
                 logger.Error("ex.Message : " + ex.Message);
                 logger.Error("ex.StackTrace : " + ex.StackTrace);
             }
             logger.Error("AuthenticateInstagram => " + Convert.ToString(group["GroupName"]) + ConfigurationManager.AppSettings["DefaultGroupName"].ToString());
             if (Convert.ToString(group["GroupName"]) == ConfigurationManager.AppSettings["DefaultGroupName"].ToString())
             {
                 if (profilecount < totalaccount)
                 {
                     logger.Error("AuthenticateInstagram => " + profilecount.ToString());
                     Api.Instagram.Instagram ApiobjInstagram = new Api.Instagram.Instagram();
                     string redirecturl = ApiobjInstagram.GetInstagramRedirectUrl(ConfigurationManager.AppSettings["InstagramClientKey"], ConfigurationManager.AppSettings["InstagramClientSec"], ConfigurationManager.AppSettings["InstagramCallBackURL"]);
                     logger.Error("AuthenticateInstagram => redirect uri =>" + redirecturl);
                     if (redirecturl.Contains("FacebookManager") || redirecturl.Contains("Facebook"))
                     {
                         redirecturl = redirecturl.Replace("FacebookManager", "InstagramManager").Replace("Facebook", "Instagram");
                         Response.Redirect(redirecturl);
                     }
                     else
                     {
                         Response.Redirect(redirecturl);
                     }
                     
                 }
                 else if (profilecount == 0 || totalaccount == 0)
                 {
                     Api.Instagram.Instagram ApiobjInstagram = new Api.Instagram.Instagram();
                     string redirecturl = ApiobjInstagram.GetInstagramRedirectUrl(ConfigurationManager.AppSettings["InstagramClientKey"], ConfigurationManager.AppSettings["InstagramClientSec"], ConfigurationManager.AppSettings["InstagramCallBackURL"]);
                     logger.Error("AuthenticateInstagram => redirect uri =>" + redirecturl);
                     if (redirecturl.Contains("FacebookManager") || redirecturl.Contains("Facebook"))
                     {
                         redirecturl = redirecturl.Replace("FacebookManager","InstagramManager").Replace("Facebook","Instagram");
                         Response.Redirect(redirecturl);
                     }
                     else
                     {
                         Response.Redirect(redirecturl);
                     }
                     
                 }
                 else
                 {
                     //return JavaScript("alert(\"You can't add more than "+ totalaccount +" account!\")");
                     logger.Error("AuthenticateInstagram => profilecount issue");
                     return RedirectToAction("Index", "Home");
                 }
             }
             else
             {
                 logger.Error("AuthenticateInstagram => groupIssue");
                 return RedirectToAction("Index", "Home");
             }
         }
         catch (Exception ex)
         {
             logger.Error("AuthenticateInstagram =>" +ex.StackTrace);
             logger.Error("AuthenticateInstagram =>" + ex.Message);
         }
     }
     catch (Exception ex)
     {
         logger.Error("AuthenticateInstagram =>" + ex.StackTrace);
         logger.Error("AuthenticateInstagram =>" + ex.Message);
     }
     return RedirectToAction("Index", "Home");
 }
        public ActionResult AddInstagramComment(string FeedId, string Text, string InstagramId)
        {
            Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups();

            //Domain.Socioboard.Domain.Groups objGroups = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
            Api.Instagram.Instagram ApiObjInstagram = new Api.Instagram.Instagram();
            string ret = ApiObjInstagram.AddComment("", FeedId, Text, InstagramId);
            if (!string.IsNullOrEmpty(ret))
            {

                Domain.Socioboard.MongoDomain.InstagramComment _InstagramComment = (Domain.Socioboard.MongoDomain.InstagramComment)new JavaScriptSerializer().Deserialize(ret, typeof(Domain.Socioboard.MongoDomain.InstagramComment));
                return Content(_InstagramComment.FromName);
            }
            else
            {
                return Content("");
            }

        }
Example #57
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;
        }
        public ActionResult TumblrImages(string profileid, string load)
        {
            if (load == "first")
            {
                Session["TumblerProfileIdForImages"] = profileid;
                tumblerimagecount = 0;
            }
            else
            {
                profileid = (string)Session["TumblerProfileIdForImages"];
                tumblerimagecount = tumblerimagecount + 6;
            }

            object lstobject = new object();
            List<object> lstComment = null;
            Dictionary<string, Dictionary<object, List<object>>> dictwallposts = new Dictionary<string, Dictionary<object, List<object>>>();
            Dictionary<object, List<object>> dic_TumblrImg = new Dictionary<object, List<object>>();
            Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups();
            Domain.Socioboard.Domain.Groups objGroups = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
            Api.TumblrFeed.TumblrFeed ApiobjTumblrFeed = new Api.TumblrFeed.TumblrFeed();
            //List<Domain.Socioboard.Domain.TumblrFeed> lstTumblrFeed = (List<Domain.Socioboard.Domain.TumblrFeed>)(new JavaScriptSerializer().Deserialize(ApiobjTumblrFeed.GetAllTumblrFeedOfUsers(objGroups.UserId.ToString(), profileid), typeof(List<Domain.Socioboard.Domain.TumblrFeed>)));
            //GetFeedsOfProfileWithRange
            List<Domain.Socioboard.MongoDomain.TumblrFeed> lstTumblrFeed = (List<Domain.Socioboard.MongoDomain.TumblrFeed>)(new JavaScriptSerializer().Deserialize(ApiobjTumblrFeed.GetAllTumblrFeedOfUsersWithRange(objGroups.UserId.ToString(), profileid, tumblerimagecount.ToString()), typeof(List<Domain.Socioboard.MongoDomain.TumblrFeed>)));
            foreach (var item_lstTumblrFeed in lstTumblrFeed)
            {
                lstComment = new List<object>();

                lstobject = (object)item_lstTumblrFeed;
                dic_TumblrImg.Add(lstobject, lstComment);
            }
            dictwallposts.Add("tumblr", dic_TumblrImg);
            return PartialView("_ImagePartial", dictwallposts);


        }
        public ActionResult InstagramImages(string profileid)
        {
            
            //List<object> lstobject = new List<object>();
            //Dictionary<string, List<object>> dictwallposts = new Dictionary<string, List<object>>();
            //Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups();
            //Domain.Socioboard.Domain.Groups objGroups = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
            //Api.InstagramFeed.InstagramFeed ApiobjInstagramFeed = new Api.InstagramFeed.InstagramFeed();
            //List<Domain.Socioboard.Domain.InstagramFeed> lstInstagramFeed = (List<Domain.Socioboard.Domain.InstagramFeed>)(new JavaScriptSerializer().Deserialize(ApiobjInstagramFeed.GetLinkedInFeeds(objGroups.UserId.ToString(), profileid), typeof(List<Domain.Socioboard.Domain.InstagramFeed>)));
            //foreach (var lstInstagramfeed in lstInstagramFeed)
            //{
            //    lstobject.Add(lstInstagramfeed);
            //}
            //dictwallposts.Add("instagram", lstobject);
            //return PartialView("_ImagePartial", dictwallposts);


            object lstobject = new object();
            List<object> lstComment = null;

            Dictionary<string, Dictionary<object, List<object>>> dictwallposts = new Dictionary<string, Dictionary<object, List<object>>>();
            Dictionary<object, List<object>> dic_InstgramImg = new Dictionary<object, List<object>>();
            Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups();
            Domain.Socioboard.Domain.Groups objGroups = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
            Api.InstagramFeed.InstagramFeed ApiobjInstagramFeed = new Api.InstagramFeed.InstagramFeed();
            Api.InstagramComment.InstagramComment ApiobjInstagramFeedComment = new Api.InstagramComment.InstagramComment();

            //List<Domain.Socioboard.Domain.InstagramFeed> lstInstagramFeed = (List<Domain.Socioboard.Domain.InstagramFeed>)(new JavaScriptSerializer().Deserialize(ApiobjInstagramFeed.GetLinkedInFeeds(objGroups.UserId.ToString(), profileid), typeof(List<Domain.Socioboard.Domain.InstagramFeed>)));
            List<Domain.Socioboard.MongoDomain.InstagramFeed> lstInstagramFeed = (List<Domain.Socioboard.MongoDomain.InstagramFeed>)(new JavaScriptSerializer().Deserialize(ApiobjInstagramFeed.GetFeedsOfProfileWithRange(objGroups.UserId.ToString(), profileid, "0", "8"), typeof(List<Domain.Socioboard.MongoDomain.InstagramFeed>)));

            foreach (var item_lstInstagramfeed in lstInstagramFeed)
            {
                lstComment = new List<object>();
                List<Domain.Socioboard.MongoDomain.InstagramComment> lstInstagramComment = (List<Domain.Socioboard.MongoDomain.InstagramComment>)(new JavaScriptSerializer().Deserialize(ApiobjInstagramFeedComment.GetInstagramFeedsComment(objGroups.UserId.ToString(), item_lstInstagramfeed.FeedId.ToString()), typeof(List<Domain.Socioboard.MongoDomain.InstagramComment>)));

                foreach (var item in lstInstagramComment)
                {
                    lstComment.Add(item);
                }
                lstobject = (object)item_lstInstagramfeed;
                dic_InstgramImg.Add(lstobject, lstComment);
            }
            dictwallposts.Add("instagram", dic_InstgramImg);
            return PartialView("_ImagePartial", dictwallposts);

        }
        public ActionResult TwitterMentions(string ProfileId)
        {
            List<object> lstobject = new List<object>();
            Dictionary<string, List<object>> dictMentions = new Dictionary<string, List<object>>();
            Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups();
            Domain.Socioboard.Domain.Groups objGroups = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));

            Api.TwitterMessage.TwitterMessage ApiobjTwitterMessage = new Api.TwitterMessage.TwitterMessage();
            List<Domain.Socioboard.MongoDomain.TwitterMessage> lstTwitterMentions = (List<Domain.Socioboard.MongoDomain.TwitterMessage>)(new JavaScriptSerializer().Deserialize(ApiobjTwitterMessage.getAllTwitterMentionsOfUsers(objGroups.UserId.ToString(), ProfileId), typeof(List<Domain.Socioboard.MongoDomain.TwitterMessage>)));
            foreach (var twitterMentions in lstTwitterMentions)
            {
                lstobject.Add(twitterMentions);
            }
            dictMentions.Add("twitter", lstobject);
            return PartialView("_Panel3Partial", dictMentions);
        }