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 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 AddLinkedinCompanyPage(string id, string OAuth) { Domain.Socioboard.Domain.User objUser = new Domain.Socioboard.Domain.User(); objUser = (Domain.Socioboard.Domain.User)Session["User"]; oAuthLinkedIn oauthtoken = (oAuthLinkedIn)Session["LinkedinPagedetail"]; string Oauth = new JavaScriptSerializer().Serialize(oauthtoken); //GlobusLinkedinLib.Authentication.oAuthLinkedIn _oauth = (GlobusLinkedinLib.Authentication.oAuthLinkedIn)Session["LinkedinPagedetail"]; Api.LinkedinCompanyPage.LinkedinCompanyPage objLinkedinCompanypage = new Api.LinkedinCompanyPage.LinkedinCompanyPage(); string AddLinkedinAccount = objLinkedinCompanypage.AddLinkedinCompanyPage(id, Oauth, objUser.Id.ToString(), Session["group"].ToString()); return(Content("")); }
public ActionResult CreatePostOnPage(string Pageid, string Post) { string returnContent = string.Empty; User objUser = (User)System.Web.HttpContext.Current.Session["User"]; Api.LinkedinCompanyPage.LinkedinCompanyPage ApiobjCreateUpdate = new Api.LinkedinCompanyPage.LinkedinCompanyPage(); string Return = (string)(new JavaScriptSerializer().Deserialize(ApiobjCreateUpdate.CreateUpdateOnLinkedinCompanyPage(objUser.Id.ToString(), Pageid, Post), typeof(string))); if (Return != "Something Went Wrong") { returnContent = ""; } return(Content(returnContent)); }
public ActionResult LikeCompanyPagePost(string pageid, string updatekey, string isLike) { string returnContent = string.Empty; User objUser = (User)System.Web.HttpContext.Current.Session["User"]; Api.LinkedinCompanyPage.LinkedinCompanyPage ApiobjLiPutLikeOnPageUpdate = new Api.LinkedinCompanyPage.LinkedinCompanyPage(); string Return = (string)(new JavaScriptSerializer().Deserialize(ApiobjLiPutLikeOnPageUpdate.PutLikeOnLinkedinCompanyPageUpdate(objUser.Id.ToString(), pageid, updatekey, isLike), typeof(string))); if (Return != "Something Went Wrong") { returnContent = ""; } return(Content(returnContent)); }
public ActionResult linkedinPageWallPost(string profileid) { User objUser = (User)System.Web.HttpContext.Current.Session["User"]; Api.LinkedinCompanyPage.LinkedinCompanyPage ApiobjLinkedinCompanyPageInfo = new Api.LinkedinCompanyPage.LinkedinCompanyPage(); LinkedinCompanyPage onjLiCompanyPage = (LinkedinCompanyPage)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinCompanyPageInfo.GetLinkedinCompanyPageDetailsByUserIdAndPageId(objUser.Id.ToString(), profileid), typeof(LinkedinCompanyPage))); Api.LinkedinCompanyPage.LinkedinCompanyPage ApiLinkedinPagePost = new Api.LinkedinCompanyPage.LinkedinCompanyPage(); List <LinkedinCompanyPagePosts> lstlipagepost = (List <LinkedinCompanyPagePosts>)(new JavaScriptSerializer().Deserialize(ApiLinkedinPagePost.GetAllLinkedinCompanyPagePostsByUserIdAndProfileId(objUser.Id.ToString(), profileid), typeof(List <LinkedinCompanyPagePosts>))); ViewBag.LinkedinPageInformation = onjLiCompanyPage; ViewBag.LinkedinPagePost = lstlipagepost; return(PartialView("_LinkedinCompanyPagePartial")); }
public ActionResult AddLinkedinCompanyPage(string id, string OAuth) { Domain.Socioboard.Domain.User objUser = new Domain.Socioboard.Domain.User(); objUser = (Domain.Socioboard.Domain.User)Session["User"]; oAuthLinkedIn oauthtoken = (oAuthLinkedIn)Session["LinkedinPagedetail"]; string Oauth = new JavaScriptSerializer().Serialize(oauthtoken); //GlobusLinkedinLib.Authentication.oAuthLinkedIn _oauth = (GlobusLinkedinLib.Authentication.oAuthLinkedIn)Session["LinkedinPagedetail"]; Api.LinkedinCompanyPage.LinkedinCompanyPage objLinkedinCompanypage = new Api.LinkedinCompanyPage.LinkedinCompanyPage(); string AddLinkedinAccount = objLinkedinCompanypage.AddLinkedinCompanyPage(id, Oauth, objUser.Id.ToString(), Session["group"].ToString()); return Content(""); }
private static ISocialSiteAccount GetSocialAccountFromTeamMemberProfile(Guid objUserid, Domain.Socioboard.Domain.TeamMemberProfile objTeamMemberProfile) { ISocialSiteAccount objSocialSiteAccount = null; if (objTeamMemberProfile.ProfileType == "facebook" || objTeamMemberProfile.ProfileType == "facebook_page") { using (Api.FacebookAccount.FacebookAccount ApiobjFacebookAccount = new Api.FacebookAccount.FacebookAccount()) { ApiobjFacebookAccount.Timeout = 300000; objSocialSiteAccount = (FacebookAccount)(new JavaScriptSerializer().Deserialize(ApiobjFacebookAccount.getFacebookAccountDetailsById(objUserid.ToString(), objTeamMemberProfile.ProfileId.ToString()), typeof(FacebookAccount))); } } else if (objTeamMemberProfile.ProfileType == "twitter") { using (Api.TwitterAccount.TwitterAccount ApiobjTwitterAccount = new Api.TwitterAccount.TwitterAccount()) { ApiobjTwitterAccount.Timeout = 300000; objSocialSiteAccount = (TwitterAccount)(new JavaScriptSerializer().Deserialize(ApiobjTwitterAccount.GetTwitterAccountDetailsById(objUserid.ToString(), objTeamMemberProfile.ProfileId.ToString()), typeof(TwitterAccount))); } } else if (objTeamMemberProfile.ProfileType == "linkedin") { using (Api.LinkedinAccount.LinkedinAccount ApiobjLinkedinAccount = new Api.LinkedinAccount.LinkedinAccount()) { ApiobjLinkedinAccount.Timeout = 300000; objSocialSiteAccount = (LinkedInAccount)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinAccount.GetLinkedinAccountDetailsById(objUserid.ToString(), objTeamMemberProfile.ProfileId.ToString()), typeof(LinkedInAccount))); } } else if (objTeamMemberProfile.ProfileType == "instagram") { using (Api.InstagramAccount.InstagramAccount ApiobjInstagramAccount = new Api.InstagramAccount.InstagramAccount()) { ApiobjInstagramAccount.Timeout = 300000; objSocialSiteAccount = (InstagramAccount)(new JavaScriptSerializer().Deserialize(ApiobjInstagramAccount.UserInformation(objUserid.ToString(), objTeamMemberProfile.ProfileId.ToString()), typeof(InstagramAccount))); } } else if (objTeamMemberProfile.ProfileType == "youtube") { using (Api.YoutubeAccount.YoutubeAccount ApiobjYoutubeAccount = new Api.YoutubeAccount.YoutubeAccount()) { ApiobjYoutubeAccount.Timeout = 300000; objSocialSiteAccount = (YoutubeAccount)(new JavaScriptSerializer().Deserialize(ApiobjYoutubeAccount.GetYoutubeAccountDetailsById(objUserid.ToString(), objTeamMemberProfile.ProfileId.ToString()), typeof(YoutubeAccount))); } } else if (objTeamMemberProfile.ProfileType == "tumblr") { using (Api.TumblrAccount.TumblrAccount ApiobjTumblrAccount = new Api.TumblrAccount.TumblrAccount()) { ApiobjTumblrAccount.Timeout = 300000; objSocialSiteAccount = (TumblrAccount)(new JavaScriptSerializer().Deserialize(ApiobjTumblrAccount.GetTumblrAccountDetailsById(objUserid.ToString(), objTeamMemberProfile.ProfileId.ToString()), typeof(TumblrAccount))); } } else if (objTeamMemberProfile.ProfileType == "linkedincompanypage") { using (Api.LinkedinCompanyPage.LinkedinCompanyPage objLinkedinCompanyPage = new Api.LinkedinCompanyPage.LinkedinCompanyPage()) { objLinkedinCompanyPage.Timeout = 300000; objSocialSiteAccount = (LinkedinCompanyPage)(new JavaScriptSerializer().Deserialize(objLinkedinCompanyPage.GetLinkedinCompanyPageDetailsByUserIdAndPageId(objUserid.ToString(), objTeamMemberProfile.ProfileId.ToString()), typeof(LinkedinCompanyPage))); } } else if (objTeamMemberProfile.ProfileType == "gplus") { using (Api.GooglePlusAccount.GooglePlusAccount ApiobjGooglePlusAccount = new Api.GooglePlusAccount.GooglePlusAccount()) { ApiobjGooglePlusAccount.Timeout = 300000; objSocialSiteAccount = (GooglePlusAccount)(new JavaScriptSerializer().Deserialize(ApiobjGooglePlusAccount.GetGooglePlusAccountDetailsById(objUserid.ToString(), objTeamMemberProfile.ProfileId), typeof(GooglePlusAccount))); } } return objSocialSiteAccount; }
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 static Dictionary<Domain.Socioboard.Domain.TeamMemberProfile, Dictionary<object, List<object>>> GetUserProfilesSnapsAccordingToGroup(List<Domain.Socioboard.Domain.TeamMemberProfile> TeamMemberProfile) //{ // User objUser = (User)System.Web.HttpContext.Current.Session["User"]; // Dictionary<Domain.Socioboard.Domain.TeamMemberProfile, Dictionary<object, List<object>>> dic_profilessnap = new Dictionary<Domain.Socioboard.Domain.TeamMemberProfile, Dictionary<object, List<object>>>(); // var dicprofilefeeds = new Dictionary<object, List<object>>(); // foreach (Domain.Socioboard.Domain.TeamMemberProfile item in TeamMemberProfile) // { // List<object> feeds = null; // if (item.ProfileType == "facebook" || item.ProfileType == "facebook_page") // { // try // { // feeds = new List<object>(); // Api.FacebookAccount.FacebookAccount ApiobjFacebookAccount = new Api.FacebookAccount.FacebookAccount(); // FacebookAccount objFacebookAccount = (FacebookAccount)(new JavaScriptSerializer().Deserialize(ApiobjFacebookAccount.getFacebookAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(FacebookAccount))); // Api.FacebookFeed.FacebookFeed ApiobjFacebookFeed = new Api.FacebookFeed.FacebookFeed(); // //List<FacebookFeed> lstFacebookFeed = (List<FacebookFeed>)(new JavaScriptSerializer().Deserialize(ApiobjFacebookFeed.getAllFacebookFeedsByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List<FacebookFeed>))); // List<FacebookFeed> lstFacebookFeed = (List<FacebookFeed>)(new JavaScriptSerializer().Deserialize(ApiobjFacebookFeed.getAllFacebookFeedsByUserIdAndProfileIdUsingLimit(objUser.Id.ToString(), item.ProfileId.ToString(), "0", "10"), typeof(List<FacebookFeed>))); // foreach (var facebookfeed in lstFacebookFeed) // { // feeds.Add(facebookfeed); // } // dicprofilefeeds.Add(objFacebookAccount, feeds); // dic_profilessnap.Add(item, dicprofilefeeds); // } // catch (Exception ex) // { // Console.WriteLine(ex.Message); // } // } // if (item.ProfileType == "twitter") // { // try // { // feeds = new List<object>(); // Api.TwitterAccount.TwitterAccount ApiobjTwitterAccount = new Api.TwitterAccount.TwitterAccount(); // TwitterAccount objTwitterAccount = (TwitterAccount)(new JavaScriptSerializer().Deserialize(ApiobjTwitterAccount.GetTwitterAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(TwitterAccount))); // Api.TwitterFeed.TwitterFeed ApiobjTwitterFeed = new Api.TwitterFeed.TwitterFeed(); // //List<TwitterFeed> lstTwitterFeed = (List<TwitterFeed>)(new JavaScriptSerializer().Deserialize(ApiobjTwitterFeed.GetAllTwitterFeedsByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List<TwitterFeed>))); // List<TwitterFeed> lstTwitterFeed = (List<TwitterFeed>)(new JavaScriptSerializer().Deserialize(ApiobjTwitterFeed.getAllFeedsByUserIdAndProfileIdUsingLimit(objUser.Id.ToString(), item.ProfileId.ToString(),"0","10"), typeof(List<TwitterFeed>))); // foreach (var twitterfeed in lstTwitterFeed) // { // feeds.Add(twitterfeed); // } // dicprofilefeeds.Add(objTwitterAccount, feeds); // dic_profilessnap.Add(item, dicprofilefeeds); // } // catch (Exception ex) // { // Console.WriteLine(ex.Message); // } // } // if (item.ProfileType == "linkedin") // { // try // { // feeds = new List<object>(); // Api.LinkedinAccount.LinkedinAccount ApiobjLinkedinAccount = new Api.LinkedinAccount.LinkedinAccount(); // LinkedInAccount objLinkedInAccount = (LinkedInAccount)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinAccount.GetLinkedinAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(LinkedInAccount))); // Api.LinkedInFeed.LinkedInFeed ApiobjLinkedInFeed = new Api.LinkedInFeed.LinkedInFeed(); // //List<LinkedInFeed> lstLinkedInFeed = (List<LinkedInFeed>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedInFeed.GetLinkedInFeeds(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List<LinkedInFeed>))); // List<LinkedInFeed> lstLinkedInFeed = (List<LinkedInFeed>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedInFeed.GetLinkedInFeedsByUserIdAndProfileIdUsingLimit(objUser.Id.ToString(), item.ProfileId.ToString(), "0", "10"), typeof(List<LinkedInFeed>))); // foreach (var LinkedInFeed in lstLinkedInFeed) // { // feeds.Add(LinkedInFeed); // } // dicprofilefeeds.Add(objLinkedInAccount, feeds); // dic_profilessnap.Add(item, dicprofilefeeds); // } // catch (Exception ex) // { // Console.WriteLine(ex.Message); // } // } // if (item.ProfileType == "instagram") // { // try // { // feeds = new List<object>(); // Api.InstagramAccount.InstagramAccount ApiobjInstagramAccount = new Api.InstagramAccount.InstagramAccount(); // InstagramAccount objInstagramAccount = (InstagramAccount)(new JavaScriptSerializer().Deserialize(ApiobjInstagramAccount.UserInformation(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(InstagramAccount))); // dicprofilefeeds.Add(objInstagramAccount, feeds); // dic_profilessnap.Add(item, dicprofilefeeds); // } // catch (Exception ex) // { // Console.WriteLine(ex.Message); // } // } // if (item.ProfileType == "tumblr") // { // try // { // feeds = new List<object>(); // Api.TumblrAccount.TumblrAccount ApiobjTumblrAccount = new Api.TumblrAccount.TumblrAccount(); // TumblrAccount objTumblrAccount = (TumblrAccount)(new JavaScriptSerializer().Deserialize(ApiobjTumblrAccount.GetTumblrAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(TumblrAccount))); // dicprofilefeeds.Add(objTumblrAccount, feeds); // dic_profilessnap.Add(item, dicprofilefeeds); // } // catch (Exception ex) // { // Console.WriteLine(ex.Message); // } // } // if (item.ProfileType == "youtube") // { // try // { // feeds = new List<object>(); // Api.YoutubeAccount.YoutubeAccount ApiobjYoutubeAccount = new Api.YoutubeAccount.YoutubeAccount(); // YoutubeAccount objYoutubeAccount = (YoutubeAccount)(new JavaScriptSerializer().Deserialize(ApiobjYoutubeAccount.GetYoutubeAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(YoutubeAccount))); // Api.YoutubeChannel.YoutubeChannel ApiobjYoutubeChannel = new Api.YoutubeChannel.YoutubeChannel(); // YoutubeChannel objYoutubeChannel = (YoutubeChannel)(new JavaScriptSerializer().Deserialize(ApiobjYoutubeChannel.GetAllYoutubeChannelByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(YoutubeChannel))); // List<YoutubeChannel> lstYoutubeChannel = new List<YoutubeChannel>(); // lstYoutubeChannel.Add(objYoutubeChannel); // foreach (var youtubechannel in lstYoutubeChannel) // { // feeds.Add(youtubechannel); // } // dicprofilefeeds.Add(objYoutubeAccount, feeds); // dic_profilessnap.Add(item, dicprofilefeeds); // } // catch (Exception ex) // { // Console.WriteLine(ex.Message); // } // } // if (item.ProfileType == "linkedincompanypage") // { // try // { // feeds = new List<object>(); // Api.LinkedinCompanyPage.LinkedinCompanyPage ApiobjLinkedinCompanyPage = new Api.LinkedinCompanyPage.LinkedinCompanyPage(); // LinkedinCompanyPage objLinkedinCompanypage = (LinkedinCompanyPage)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinCompanyPage.GetLinkedinCompanyPageDetailsByUserIdAndPageId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(LinkedinCompanyPage))); // Api.LinkedinCompanyPage.LinkedinCompanyPage ApiobjLinkedinCompanyPagePost = new Api.LinkedinCompanyPage.LinkedinCompanyPage(); // List<LinkedinCompanyPagePosts> lstlipagepost = (List<LinkedinCompanyPagePosts>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinCompanyPagePost.GetAllLinkedinCompanyPagePostsByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List<LinkedinCompanyPagePosts>))); // foreach (var lipagepost in lstlipagepost) // { // feeds.Add(lipagepost); // } // dicprofilefeeds.Add(objLinkedinCompanypage, feeds); // dic_profilessnap.Add(item, dicprofilefeeds); // } // catch (Exception ex) // { // Console.WriteLine(ex.Message); // } // } // } // return dic_profilessnap; //} public static Dictionary<Domain.Socioboard.Domain.TeamMemberProfile, Dictionary<object, List<object>>> GetUserProfilesSnapsAccordingToGroup(List<Domain.Socioboard.Domain.TeamMemberProfile> TeamMemberProfile, int CountProfileSnapshot = 0) { User objUser = (User)System.Web.HttpContext.Current.Session["User"]; Dictionary<Domain.Socioboard.Domain.TeamMemberProfile, Dictionary<object, List<object>>> dic_profilessnap = new Dictionary<Domain.Socioboard.Domain.TeamMemberProfile, Dictionary<object, List<object>>>(); var dicprofilefeeds = new Dictionary<object, List<object>>(); int tempCount = 0; foreach (Domain.Socioboard.Domain.TeamMemberProfile item in TeamMemberProfile) { tempCount++; if (tempCount <= CountProfileSnapshot) { continue; } //to load only 3 profiles on home page load to speed up page loading if (dic_profilessnap.Count >= 3) { break; } List<object> feeds = null; if (item.ProfileType == "facebook" || item.ProfileType == "facebook_page") { try { feeds = new List<object>(); Api.FacebookAccount.FacebookAccount ApiobjFacebookAccount = new Api.FacebookAccount.FacebookAccount(); ApiobjFacebookAccount.Timeout = 300000; FacebookAccount objFacebookAccount = (FacebookAccount)(new JavaScriptSerializer().Deserialize(ApiobjFacebookAccount.getFacebookAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(FacebookAccount))); Api.FacebookFeed.FacebookFeed ApiobjFacebookFeed = new Api.FacebookFeed.FacebookFeed(); ApiobjFacebookFeed.Timeout = 300000; //List<FacebookFeed> lstFacebookFeed = (List<FacebookFeed>)(new JavaScriptSerializer().Deserialize(ApiobjFacebookFeed.getAllFacebookFeedsByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List<FacebookFeed>))); List<FacebookFeed> lstFacebookFeed = (List<FacebookFeed>)(new JavaScriptSerializer().Deserialize(ApiobjFacebookFeed.getAllFacebookFeedsByUserIdAndProfileIdUsingLimit(objUser.Id.ToString(), item.ProfileId.ToString(), "0", "10"), typeof(List<FacebookFeed>))); foreach (var facebookfeed in lstFacebookFeed) { feeds.Add(facebookfeed); } dicprofilefeeds.Add(objFacebookAccount, feeds); dic_profilessnap.Add(item, dicprofilefeeds); } catch (Exception ex) { Console.WriteLine(ex.Message); } } if (item.ProfileType == "twitter") { try { feeds = new List<object>(); Api.TwitterAccount.TwitterAccount ApiobjTwitterAccount = new Api.TwitterAccount.TwitterAccount(); TwitterAccount objTwitterAccount = (TwitterAccount)(new JavaScriptSerializer().Deserialize(ApiobjTwitterAccount.GetTwitterAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(TwitterAccount))); Api.TwitterFeed.TwitterFeed ApiobjTwitterFeed = new Api.TwitterFeed.TwitterFeed(); ApiobjTwitterFeed.Timeout = 300000; //List<TwitterFeed> lstTwitterFeed = (List<TwitterFeed>)(new JavaScriptSerializer().Deserialize(ApiobjTwitterFeed.GetAllTwitterFeedsByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List<TwitterFeed>))); List<TwitterFeed> lstTwitterFeed = (List<TwitterFeed>)(new JavaScriptSerializer().Deserialize(ApiobjTwitterFeed.getAllFeedsByUserIdAndProfileIdUsingLimit(objUser.Id.ToString(), item.ProfileId.ToString(), "0", "10"), typeof(List<TwitterFeed>))); foreach (var twitterfeed in lstTwitterFeed) { feeds.Add(twitterfeed); } dicprofilefeeds.Add(objTwitterAccount, feeds); dic_profilessnap.Add(item, dicprofilefeeds); } catch (Exception ex) { Console.WriteLine(ex.Message); } } if (item.ProfileType == "linkedin") { try { feeds = new List<object>(); Api.LinkedinAccount.LinkedinAccount ApiobjLinkedinAccount = new Api.LinkedinAccount.LinkedinAccount(); ApiobjLinkedinAccount.Timeout = 300000; LinkedInAccount objLinkedInAccount = (LinkedInAccount)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinAccount.GetLinkedinAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(LinkedInAccount))); Api.LinkedInFeed.LinkedInFeed ApiobjLinkedInFeed = new Api.LinkedInFeed.LinkedInFeed(); ApiobjLinkedInFeed.Timeout = 300000; //List<LinkedInFeed> lstLinkedInFeed = (List<LinkedInFeed>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedInFeed.GetLinkedInFeeds(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List<LinkedInFeed>))); List<LinkedInFeed> lstLinkedInFeed = (List<LinkedInFeed>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedInFeed.GetLinkedInFeedsByUserIdAndProfileIdUsingLimit(objUser.Id.ToString(), item.ProfileId.ToString(), "0", "10"), typeof(List<LinkedInFeed>))); foreach (var LinkedInFeed in lstLinkedInFeed) { feeds.Add(LinkedInFeed); } dicprofilefeeds.Add(objLinkedInAccount, feeds); dic_profilessnap.Add(item, dicprofilefeeds); } catch (Exception ex) { Console.WriteLine(ex.Message); } } if (item.ProfileType == "instagram") { try { feeds = new List<object>(); Api.InstagramAccount.InstagramAccount ApiobjInstagramAccount = new Api.InstagramAccount.InstagramAccount(); ApiobjInstagramAccount.Timeout = 300000; InstagramAccount objInstagramAccount = (InstagramAccount)(new JavaScriptSerializer().Deserialize(ApiobjInstagramAccount.UserInformation(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(InstagramAccount))); dicprofilefeeds.Add(objInstagramAccount, feeds); dic_profilessnap.Add(item, dicprofilefeeds); } catch (Exception ex) { Console.WriteLine(ex.Message); } } if (item.ProfileType == "tumblr") { try { feeds = new List<object>(); Api.TumblrAccount.TumblrAccount ApiobjTumblrAccount = new Api.TumblrAccount.TumblrAccount(); ApiobjTumblrAccount.Timeout = 300000; TumblrAccount objTumblrAccount = (TumblrAccount)(new JavaScriptSerializer().Deserialize(ApiobjTumblrAccount.GetTumblrAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(TumblrAccount))); dicprofilefeeds.Add(objTumblrAccount, feeds); dic_profilessnap.Add(item, dicprofilefeeds); } catch (Exception ex) { Console.WriteLine(ex.Message); } } if (item.ProfileType == "youtube") { try { feeds = new List<object>(); Api.YoutubeAccount.YoutubeAccount ApiobjYoutubeAccount = new Api.YoutubeAccount.YoutubeAccount(); ApiobjYoutubeAccount.Timeout = 300000; YoutubeAccount objYoutubeAccount = (YoutubeAccount)(new JavaScriptSerializer().Deserialize(ApiobjYoutubeAccount.GetYoutubeAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(YoutubeAccount))); Api.YoutubeChannel.YoutubeChannel ApiobjYoutubeChannel = new Api.YoutubeChannel.YoutubeChannel(); ApiobjYoutubeChannel.Timeout = 300000; YoutubeChannel objYoutubeChannel = (YoutubeChannel)(new JavaScriptSerializer().Deserialize(ApiobjYoutubeChannel.GetAllYoutubeChannelByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(YoutubeChannel))); List<YoutubeChannel> lstYoutubeChannel = new List<YoutubeChannel>(); lstYoutubeChannel.Add(objYoutubeChannel); foreach (var youtubechannel in lstYoutubeChannel) { feeds.Add(youtubechannel); } dicprofilefeeds.Add(objYoutubeAccount, feeds); dic_profilessnap.Add(item, dicprofilefeeds); } catch (Exception ex) { Console.WriteLine(ex.Message); } } if (item.ProfileType == "linkedincompanypage") { try { feeds = new List<object>(); Api.LinkedinCompanyPage.LinkedinCompanyPage ApiobjLinkedinCompanyPage = new Api.LinkedinCompanyPage.LinkedinCompanyPage(); ApiobjLinkedinCompanyPage.Timeout = 300000; LinkedinCompanyPage objLinkedinCompanypage = (LinkedinCompanyPage)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinCompanyPage.GetLinkedinCompanyPageDetailsByUserIdAndPageId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(LinkedinCompanyPage))); Api.LinkedinCompanyPage.LinkedinCompanyPage ApiobjLinkedinCompanyPagePost = new Api.LinkedinCompanyPage.LinkedinCompanyPage(); ApiobjLinkedinCompanyPage.Timeout = 300000; List<LinkedinCompanyPagePosts> lstlipagepost = (List<LinkedinCompanyPagePosts>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinCompanyPagePost.GetAllLinkedinCompanyPagePostsByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List<LinkedinCompanyPagePosts>))); foreach (var lipagepost in lstlipagepost) { feeds.Add(lipagepost); } dicprofilefeeds.Add(objLinkedinCompanypage, feeds); dic_profilessnap.Add(item, dicprofilefeeds); } catch (Exception ex) { Console.WriteLine(ex.Message); } } if (item.ProfileType == "gplus") { try { feeds = new List<object>(); Api.GooglePlusAccount.GooglePlusAccount ApiobjGooglePlusAccount = new Api.GooglePlusAccount.GooglePlusAccount(); ApiobjGooglePlusAccount.Timeout = 300000; Domain.Socioboard.Domain.GooglePlusAccount _GooglePlusAccount = (GooglePlusAccount)new JavaScriptSerializer().Deserialize(ApiobjGooglePlusAccount.GetGooglePlusAccountDetailsById(objUser.Id.ToString(), item.ProfileId), typeof(GooglePlusAccount)); dicprofilefeeds.Add(_GooglePlusAccount, feeds); dic_profilessnap.Add(item, dicprofilefeeds); } catch (Exception ex) { Console.WriteLine(ex.Message); } } } return dic_profilessnap; }
public ActionResult DeleteAccount() { string type = Request.QueryString["profile"].ToString(); string profileid = Request.QueryString["profileid"].ToString(); Domain.Socioboard.Domain.User objUser = (Domain.Socioboard.Domain.User)Session["User"]; // Edited By Antima[15/12/2014] string GroupId = Session["group"].ToString(); Api.Team.Team objApiTeam = new Api.Team.Team(); objApiTeam.Timeout = 300000; Domain.Socioboard.Domain.Team team = (Domain.Socioboard.Domain.Team)new JavaScriptSerializer().Deserialize(objApiTeam.GetTeamByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Team)); Guid AdminUserId = team.UserId; try { if (AdminUserId == objUser.Id) { if (type == "fb") { Api.FacebookAccount.FacebookAccount ApiobjFacebookAccount = new Api.FacebookAccount.FacebookAccount(); ApiobjFacebookAccount.DeleteFacebookAccount(objUser.Id.ToString(), profileid, Session["group"].ToString()); } else if (type == "twt") { Api.TwitterAccount.TwitterAccount apiobjTwitterAccount = new Api.TwitterAccount.TwitterAccount(); apiobjTwitterAccount.DeleteTwitterAccount(objUser.Id.ToString(), profileid, Session["group"].ToString()); } else if (type == "linkedin") { Api.LinkedinAccount.LinkedinAccount apiobjLinkedinAccount = new Api.LinkedinAccount.LinkedinAccount(); apiobjLinkedinAccount.DeleteLinkedinAccount(objUser.Id.ToString(), profileid, Session["group"].ToString()); } else if (type == "instagram") { Api.InstagramAccount.InstagramAccount apiobjInstagramAccount = new Api.InstagramAccount.InstagramAccount(); apiobjInstagramAccount.DeleteInstagramAccount(objUser.Id.ToString(), profileid, Session["group"].ToString()); } else if (type == "tumblr") { Api.TumblrAccount.TumblrAccount apiobjTumblrAccount = new Api.TumblrAccount.TumblrAccount(); apiobjTumblrAccount.DeleteTumblrAccount(objUser.Id.ToString(), profileid, Session["group"].ToString()); } else if (type == "youtube") { Api.YoutubeAccount.YoutubeAccount apiobjYoutubeAccount = new Api.YoutubeAccount.YoutubeAccount(); apiobjYoutubeAccount.DeleteYoutubeAccount(objUser.Id.ToString(), profileid, Session["group"].ToString()); } else if (type == "liComPage") { Api.LinkedinCompanyPage.LinkedinCompanyPage apiobjLinkedinCompanyPage = new Api.LinkedinCompanyPage.LinkedinCompanyPage(); apiobjLinkedinCompanyPage.DeleteLinkedinCompanyPage(objUser.Id.ToString(), profileid, Session["group"].ToString()); } else if (type == "gplus") { Api.GooglePlusAccount.GooglePlusAccount objGooglePlusAccount = new Api.GooglePlusAccount.GooglePlusAccount(); objGooglePlusAccount.DeleteGplusAccount(objUser.Id.ToString(), profileid, Session["group"].ToString()); } return Content("Deleted"); } else { return Content("Not Deleted"); } } catch (Exception ex) { Console.WriteLine(ex.StackTrace); return Content("Not Deleted"); } }
public ActionResult LikeCompanyPagePost(string pageid, string updatekey, string isLike) { string returnContent = string.Empty; User objUser = (User)System.Web.HttpContext.Current.Session["User"]; Api.LinkedinCompanyPage.LinkedinCompanyPage ApiobjLiPutLikeOnPageUpdate = new Api.LinkedinCompanyPage.LinkedinCompanyPage(); string Return = (string)(new JavaScriptSerializer().Deserialize(ApiobjLiPutLikeOnPageUpdate.PutLikeOnLinkedinCompanyPageUpdate(objUser.Id.ToString(), pageid, updatekey, isLike), typeof(string))); if (Return != "Something Went Wrong") { returnContent = ""; } return Content(returnContent); }
public ActionResult linkedinPageWallPost(string profileid) { User objUser = (User)System.Web.HttpContext.Current.Session["User"]; Api.LinkedinCompanyPage.LinkedinCompanyPage ApiobjLinkedinCompanyPageInfo = new Api.LinkedinCompanyPage.LinkedinCompanyPage(); LinkedinCompanyPage onjLiCompanyPage = (LinkedinCompanyPage)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinCompanyPageInfo.GetLinkedinCompanyPageDetailsByUserIdAndPageId(objUser.Id.ToString(), profileid), typeof(LinkedinCompanyPage))); Api.LinkedinCompanyPage.LinkedinCompanyPage ApiLinkedinPagePost = new Api.LinkedinCompanyPage.LinkedinCompanyPage(); List<LinkedinCompanyPagePosts> lstlipagepost = (List<LinkedinCompanyPagePosts>)(new JavaScriptSerializer().Deserialize(ApiLinkedinPagePost.GetAllLinkedinCompanyPagePostsByUserIdAndProfileId(objUser.Id.ToString(), profileid), typeof(List<LinkedinCompanyPagePosts>))); ViewBag.LinkedinPageInformation = onjLiCompanyPage; ViewBag.LinkedinPagePost = lstlipagepost; return PartialView("_LinkedinCompanyPagePartial"); }
public ActionResult DeleteAccount() { string type = Request.QueryString["profile"].ToString(); string profileid = Request.QueryString["profileid"].ToString(); Domain.Socioboard.Domain.User objUser = (Domain.Socioboard.Domain.User)Session["User"]; // Edited By Antima[15/12/2014] string GroupId = Session["group"].ToString(); Api.Team.Team objApiTeam = new Api.Team.Team(); objApiTeam.Timeout = 300000; Domain.Socioboard.Domain.Team team = (Domain.Socioboard.Domain.Team) new JavaScriptSerializer().Deserialize(objApiTeam.GetTeamByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Team)); Guid AdminUserId = team.UserId; try { if (AdminUserId == objUser.Id) { if (type == "fb") { Api.FacebookAccount.FacebookAccount ApiobjFacebookAccount = new Api.FacebookAccount.FacebookAccount(); ApiobjFacebookAccount.DeleteFacebookAccount(objUser.Id.ToString(), profileid, Session["group"].ToString()); } else if (type == "twt") { Api.TwitterAccount.TwitterAccount apiobjTwitterAccount = new Api.TwitterAccount.TwitterAccount(); apiobjTwitterAccount.DeleteTwitterAccount(objUser.Id.ToString(), profileid, Session["group"].ToString()); } else if (type == "linkedin") { Api.LinkedinAccount.LinkedinAccount apiobjLinkedinAccount = new Api.LinkedinAccount.LinkedinAccount(); apiobjLinkedinAccount.DeleteLinkedinAccount(objUser.Id.ToString(), profileid, Session["group"].ToString()); } else if (type == "instagram") { Api.InstagramAccount.InstagramAccount apiobjInstagramAccount = new Api.InstagramAccount.InstagramAccount(); apiobjInstagramAccount.DeleteInstagramAccount(objUser.Id.ToString(), profileid, Session["group"].ToString()); } else if (type == "tumblr") { Api.TumblrAccount.TumblrAccount apiobjTumblrAccount = new Api.TumblrAccount.TumblrAccount(); apiobjTumblrAccount.DeleteTumblrAccount(objUser.Id.ToString(), profileid, Session["group"].ToString()); } else if (type == "youtube") { Api.YoutubeAccount.YoutubeAccount apiobjYoutubeAccount = new Api.YoutubeAccount.YoutubeAccount(); apiobjYoutubeAccount.DeleteYoutubeAccount(objUser.Id.ToString(), profileid, Session["group"].ToString()); } else if (type == "liComPage") { Api.LinkedinCompanyPage.LinkedinCompanyPage apiobjLinkedinCompanyPage = new Api.LinkedinCompanyPage.LinkedinCompanyPage(); apiobjLinkedinCompanyPage.DeleteLinkedinCompanyPage(objUser.Id.ToString(), profileid, Session["group"].ToString()); } else if (type == "gplus") { Api.GooglePlusAccount.GooglePlusAccount objGooglePlusAccount = new Api.GooglePlusAccount.GooglePlusAccount(); objGooglePlusAccount.DeleteGplusAccount(objUser.Id.ToString(), profileid, Session["group"].ToString()); } return(Content("Deleted")); } else { return(Content("Not Deleted")); } } catch (Exception ex) { Console.WriteLine(ex.StackTrace); return(Content("Not Deleted")); } }
public ActionResult CreatePostOnPage(string Pageid, string Post) { string returnContent = string.Empty; User objUser = (User)System.Web.HttpContext.Current.Session["User"]; Api.LinkedinCompanyPage.LinkedinCompanyPage ApiobjCreateUpdate = new Api.LinkedinCompanyPage.LinkedinCompanyPage(); string Return = (string)(new JavaScriptSerializer().Deserialize(ApiobjCreateUpdate.CreateUpdateOnLinkedinCompanyPage(objUser.Id.ToString(), Pageid, Post), typeof(string))); if (Return != "Something Went Wrong") { returnContent = ""; } return Content(returnContent); }
public static Dictionary <Domain.Socioboard.Domain.GroupProfile, Dictionary <object, List <object> > > GetUserProfilesSnapsAccordingToGroup(List <Domain.Socioboard.Domain.GroupProfile> groupProfile, User objUser, int CountProfileSnapshot = 0) { // User objUser = (User)System.Web.HttpContext.Current.Session["User"]; Dictionary <Domain.Socioboard.Domain.GroupProfile, Dictionary <object, List <object> > > dic_profilessnap = new Dictionary <Domain.Socioboard.Domain.GroupProfile, Dictionary <object, List <object> > >(); var dicprofilefeeds = new Dictionary <object, List <object> >(); List <GroupProfile> lstprofile = groupProfile.Where(t => t.ProfileType != "linkedin").ToList(); int tempCount = 0; foreach (Domain.Socioboard.Domain.GroupProfile item in lstprofile) { tempCount++; if (tempCount <= CountProfileSnapshot) { continue; } //to load only 3 profiles on home page load to speed up page loading if (dic_profilessnap.Count >= 3) { break; } List <object> feeds = null; if (item.ProfileType == "facebook" || item.ProfileType == "facebook_page") { try { feeds = new List <object>(); Api.FacebookAccount.FacebookAccount ApiobjFacebookAccount = new Api.FacebookAccount.FacebookAccount(); ApiobjFacebookAccount.Timeout = 300000; FacebookAccount objFacebookAccount = (FacebookAccount)(new JavaScriptSerializer().Deserialize(ApiobjFacebookAccount.getFacebookAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(FacebookAccount))); Api.FacebookFeed.FacebookFeed ApiobjFacebookFeed = new Api.FacebookFeed.FacebookFeed(); ApiobjFacebookFeed.Timeout = 300000; //List<FacebookFeed> lstFacebookFeed = (List<FacebookFeed>)(new JavaScriptSerializer().Deserialize(ApiobjFacebookFeed.getAllFacebookFeedsByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List<FacebookFeed>))); List <MongoFacebookFeed> lstFacebookFeed = (List <MongoFacebookFeed>)(new JavaScriptSerializer().Deserialize(ApiobjFacebookFeed.getAllFacebookFeedsByUserIdAndProfileIdUsingLimit(objUser.Id.ToString(), item.ProfileId.ToString(), "0", "10"), typeof(List <MongoFacebookFeed>))); foreach (var facebookfeed in lstFacebookFeed) { feeds.Add(facebookfeed); } dicprofilefeeds.Add(objFacebookAccount, feeds); dic_profilessnap.Add(item, dicprofilefeeds); } catch (Exception ex) { Console.WriteLine(ex.Message); } } if (item.ProfileType == "twitter") { try { feeds = new List <object>(); Api.TwitterAccount.TwitterAccount ApiobjTwitterAccount = new Api.TwitterAccount.TwitterAccount(); TwitterAccount objTwitterAccount = (TwitterAccount)(new JavaScriptSerializer().Deserialize(ApiobjTwitterAccount.GetTwitterAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(TwitterAccount))); Api.TwitterFeed.TwitterFeed ApiobjTwitterFeed = new Api.TwitterFeed.TwitterFeed(); ApiobjTwitterFeed.Timeout = 300000; //List<TwitterFeed> lstTwitterFeed = (List<TwitterFeed>)(new JavaScriptSerializer().Deserialize(ApiobjTwitterFeed.GetAllTwitterFeedsByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List<TwitterFeed>))); List <Domain.Socioboard.MongoDomain.TwitterFeed> lstTwitterFeed = (List <Domain.Socioboard.MongoDomain.TwitterFeed>)(new JavaScriptSerializer().Deserialize(ApiobjTwitterFeed.getAllFeedsByUserIdAndProfileIdUsingLimit(objUser.Id.ToString(), item.ProfileId.ToString(), "0", "10"), typeof(List <Domain.Socioboard.MongoDomain.TwitterFeed>))); foreach (var twitterfeed in lstTwitterFeed) { feeds.Add(twitterfeed); } dicprofilefeeds.Add(objTwitterAccount, feeds); dic_profilessnap.Add(item, dicprofilefeeds); } catch (Exception ex) { Console.WriteLine(ex.Message); } } if (item.ProfileType == "linkedin") { try { feeds = new List <object>(); Api.LinkedinAccount.LinkedinAccount ApiobjLinkedinAccount = new Api.LinkedinAccount.LinkedinAccount(); ApiobjLinkedinAccount.Timeout = 300000; LinkedInAccount objLinkedInAccount = (LinkedInAccount)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinAccount.GetLinkedinAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(LinkedInAccount))); Api.LinkedInFeed.LinkedInFeed ApiobjLinkedInFeed = new Api.LinkedInFeed.LinkedInFeed(); ApiobjLinkedInFeed.Timeout = 300000; //List<LinkedInFeed> lstLinkedInFeed = (List<LinkedInFeed>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedInFeed.GetLinkedInFeeds(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List<LinkedInFeed>))); List <LinkedInFeed> lstLinkedInFeed = (List <LinkedInFeed>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedInFeed.GetLinkedInFeedsByUserIdAndProfileIdUsingLimit(objUser.Id.ToString(), item.ProfileId.ToString(), "0", "10"), typeof(List <LinkedInFeed>))); foreach (var LinkedInFeed in lstLinkedInFeed) { feeds.Add(LinkedInFeed); } dicprofilefeeds.Add(objLinkedInAccount, feeds); dic_profilessnap.Add(item, dicprofilefeeds); } catch (Exception ex) { Console.WriteLine(ex.Message); } } if (item.ProfileType == "instagram") { try { feeds = new List <object>(); Api.InstagramAccount.InstagramAccount ApiobjInstagramAccount = new Api.InstagramAccount.InstagramAccount(); ApiobjInstagramAccount.Timeout = 300000; InstagramAccount objInstagramAccount = (InstagramAccount)(new JavaScriptSerializer().Deserialize(ApiobjInstagramAccount.UserInformation(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(InstagramAccount))); dicprofilefeeds.Add(objInstagramAccount, feeds); dic_profilessnap.Add(item, dicprofilefeeds); } catch (Exception ex) { Console.WriteLine(ex.Message); } } if (item.ProfileType == "tumblr") { try { feeds = new List <object>(); Api.TumblrAccount.TumblrAccount ApiobjTumblrAccount = new Api.TumblrAccount.TumblrAccount(); ApiobjTumblrAccount.Timeout = 300000; TumblrAccount objTumblrAccount = (TumblrAccount)(new JavaScriptSerializer().Deserialize(ApiobjTumblrAccount.GetTumblrAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(TumblrAccount))); dicprofilefeeds.Add(objTumblrAccount, feeds); dic_profilessnap.Add(item, dicprofilefeeds); } catch (Exception ex) { Console.WriteLine(ex.Message); } } if (item.ProfileType == "youtube") { try { feeds = new List <object>(); Api.YoutubeAccount.YoutubeAccount ApiobjYoutubeAccount = new Api.YoutubeAccount.YoutubeAccount(); ApiobjYoutubeAccount.Timeout = 300000; YoutubeAccount objYoutubeAccount = (YoutubeAccount)(new JavaScriptSerializer().Deserialize(ApiobjYoutubeAccount.GetYoutubeAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(YoutubeAccount))); Api.YoutubeChannel.YoutubeChannel ApiobjYoutubeChannel = new Api.YoutubeChannel.YoutubeChannel(); ApiobjYoutubeChannel.Timeout = 300000; List <YoutubeChannel> lstYoutubeChannel = (List <YoutubeChannel>)(new JavaScriptSerializer().Deserialize(ApiobjYoutubeChannel.GetAllYoutubeChannelByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List <YoutubeChannel>))); //List<YoutubeChannel> lstYoutubeChannel = new List<YoutubeChannel>(); //lstYoutubeChannel.Add(objYoutubeChannel); foreach (var youtubechannel in lstYoutubeChannel) { feeds.Add(youtubechannel); } dicprofilefeeds.Add(objYoutubeAccount, feeds); dic_profilessnap.Add(item, dicprofilefeeds); } catch (Exception ex) { Console.WriteLine(ex.Message); } } if (item.ProfileType == "linkedincompanypage") { try { feeds = new List <object>(); Api.LinkedinCompanyPage.LinkedinCompanyPage ApiobjLinkedinCompanyPage = new Api.LinkedinCompanyPage.LinkedinCompanyPage(); ApiobjLinkedinCompanyPage.Timeout = 300000; LinkedinCompanyPage objLinkedinCompanypage = (LinkedinCompanyPage)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinCompanyPage.GetLinkedinCompanyPageDetailsByUserIdAndPageId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(LinkedinCompanyPage))); Api.LinkedinCompanyPage.LinkedinCompanyPage ApiobjLinkedinCompanyPagePost = new Api.LinkedinCompanyPage.LinkedinCompanyPage(); ApiobjLinkedinCompanyPage.Timeout = 300000; List <LinkedinCompanyPagePosts> lstlipagepost = (List <LinkedinCompanyPagePosts>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinCompanyPagePost.GetAllLinkedinCompanyPagePostsByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List <LinkedinCompanyPagePosts>))); foreach (var lipagepost in lstlipagepost) { feeds.Add(lipagepost); } dicprofilefeeds.Add(objLinkedinCompanypage, feeds); dic_profilessnap.Add(item, dicprofilefeeds); } catch (Exception ex) { Console.WriteLine(ex.Message); } } if (item.ProfileType == "gplus") { try { feeds = new List <object>(); Api.GooglePlusAccount.GooglePlusAccount ApiobjGooglePlusAccount = new Api.GooglePlusAccount.GooglePlusAccount(); ApiobjGooglePlusAccount.Timeout = 300000; Domain.Socioboard.Domain.GooglePlusAccount _GooglePlusAccount = (GooglePlusAccount) new JavaScriptSerializer().Deserialize(ApiobjGooglePlusAccount.GetGooglePlusAccountDetailsById(objUser.Id.ToString(), item.ProfileId), typeof(GooglePlusAccount)); dicprofilefeeds.Add(_GooglePlusAccount, feeds); dic_profilessnap.Add(item, dicprofilefeeds); } catch (Exception ex) { Console.WriteLine(ex.Message); } } if (item.ProfileType == "googleanalytics") { try { feeds = new List <object>(); Api.GoogleAnalyticsAccount.GoogleAnalyticsAccount ApiobjGoogleAnalyticsAccount = new Api.GoogleAnalyticsAccount.GoogleAnalyticsAccount(); ApiobjGoogleAnalyticsAccount.Timeout = 300000; Domain.Socioboard.Domain.GoogleAnalyticsAccount _GoogleAnalyticsAccount = (GoogleAnalyticsAccount) new JavaScriptSerializer().Deserialize(ApiobjGoogleAnalyticsAccount.GetGooglePlusAccountDetailsById(objUser.Id.ToString(), item.ProfileId), typeof(GoogleAnalyticsAccount)); dicprofilefeeds.Add(_GoogleAnalyticsAccount, feeds); dic_profilessnap.Add(item, dicprofilefeeds); } catch (Exception ex) { Console.WriteLine(ex.Message); } } } return(dic_profilessnap); }