public void GetData(object UserId) { Guid userId = (Guid)UserId; LinkedInHelper objliHelper = new LinkedInHelper(); LinkedInAccountRepository objLiRepo = new LinkedInAccountRepository(); oAuthLinkedIn _oauth = new oAuthLinkedIn(); ArrayList arrLiAccount = objLiRepo.getAllLinkedinAccountsOfUser(userId); foreach (LinkedInAccount itemLi in arrLiAccount) { _oauth.Token = itemLi.OAuthToken; _oauth.TokenSecret = itemLi.OAuthSecret; _oauth.Verifier = itemLi.OAuthVerifier; objliHelper.GetUserProfile(_oauth, itemLi.LinkedinUserId, userId); objliHelper.GetLinkedInFeeds(_oauth, itemLi.LinkedinUserId, userId); } }
public DataSet bindFeedsIntoDataTable(User user, string network) { Messages mstable = new Messages(); DataSet ds = DataTableGenerator.CreateDataSetForTable(mstable); if (!string.IsNullOrEmpty(network)) { /*Facebook region*/ if (network == "facebook") { FacebookAccountRepository fbaccount = new FacebookAccountRepository(); FacebookMessageRepository fbmsg = new FacebookMessageRepository(); ArrayList alstfbaccount = fbaccount.getAllFacebookAccountsOfUser(user.Id); foreach (FacebookAccount item in alstfbaccount) { List <FacebookMessage> lstfbmsg = fbmsg.getAllFacebookMessagesOfUser(user.Id, item.FbUserId); foreach (FacebookMessage facebookmsg in lstfbmsg) { ds.Tables[0].Rows.Add(facebookmsg.ProfileId, "facebook", facebookmsg.FromId, facebookmsg.FromName, facebookmsg.FromProfileUrl, facebookmsg.MessageDate, facebookmsg.Message, facebookmsg.FbComment, facebookmsg.FbLike, facebookmsg.MessageId, facebookmsg.Type); } } } else if (network == "twitter") { TwitterAccountRepository twtaccountrepo = new TwitterAccountRepository(); TwitterFeedRepository twtfeedrepo = new TwitterFeedRepository(); ArrayList alsttwtaccount = twtaccountrepo.getAllTwitterAccountsOfUser(user.Id); foreach (TwitterAccount item in alsttwtaccount) { List <TwitterFeed> lsttwtmsg = twtfeedrepo.getAllTwitterFeedOfUsers(user.Id, item.TwitterUserId); foreach (TwitterFeed twtmsg in lsttwtmsg) { ds.Tables[0].Rows.Add(twtmsg.ProfileId, "twitter", twtmsg.FromId, twtmsg.FromScreenName, twtmsg.FromProfileUrl, twtmsg.FeedDate, twtmsg.Feed, "", "", twtmsg.MessageId, twtmsg.Type); } } } else if (network == "linkedin") { LinkedInAccountRepository liaccountrepo = new LinkedInAccountRepository(); LinkedInFeedRepository lifeedrepo = new LinkedInFeedRepository(); ArrayList alstliaccount = liaccountrepo.getAllLinkedinAccountsOfUser(user.Id); foreach (LinkedInAccount item in alstliaccount) { List <LinkedInFeed> lsttwtmsg = lifeedrepo.getAllLinkedInFeedsOfUser(user.Id, item.LinkedinUserId); foreach (LinkedInFeed limsg in lsttwtmsg) { ds.Tables[0].Rows.Add(limsg.ProfileId, "linkedin", limsg.FromId, limsg.FromName, limsg.FromPicUrl, limsg.FeedsDate, limsg.Feeds, "", "", "", limsg.Type); } } } else if (network == "instagram") { InstagramAccountRepository insAccRepo = new InstagramAccountRepository(); InstagramFeedRepository insFeedRepo = new InstagramFeedRepository(); ArrayList alstlistaccount = insAccRepo.getAllInstagramAccountsOfUser(user.Id); foreach (InstagramAccount item in alstlistaccount) { List <InstagramFeed> lstFeeed = insFeedRepo.getAllInstagramFeedsOfUser(user.Id, item.InstagramId); foreach (InstagramFeed insFeed in lstFeeed) { ds.Tables[0].Rows.Add(insFeed.InstagramId, "instagram", "", "", "", insFeed.FeedDate, insFeed.FeedImageUrl, "", "", insFeed.FeedId, ""); } } } } return(ds); }