public string UserInformation(string UserId, string LinkedinId) { try { Guid Userid = Guid.Parse(UserId); LinkedInAccountRepository linkedinaccrepo = new LinkedInAccountRepository(); LinkedInAccount LinkedAccount = linkedinaccrepo.getUserInformation(Userid, LinkedinId); return(new JavaScriptSerializer().Serialize(LinkedAccount)); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); return(new JavaScriptSerializer().Serialize("Please Try Again")); } }
public string GetNetworkUpdates(string UserId, string LinkedInId) { try { Guid userid = Guid.Parse(UserId); LinkedInAccountRepository linkedinAccountRepo = new LinkedInAccountRepository(); LinkedInAccount linkedAcc = linkedinAccountRepo.getUserInformation(userid, LinkedInId); LinkedInFeedRepository linkedinfeedrepo = new LinkedInFeedRepository(); List <LinkedInFeed> lstlinkedinfeeds = linkedinfeedrepo.getAllLinkedInFeedsOfProfile(LinkedInId); return(new JavaScriptSerializer().Serialize(lstlinkedinfeeds)); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); return(new JavaScriptSerializer().Serialize("Please Try Again")); } }
public IHttpActionResult GetGroupLinkedinProfiles(string GroupId, string UserId) { Guid grpId = Guid.Empty; try { grpId = Guid.Parse(GroupId); } catch (Exception ex) { logger.Error(ex.Message); logger.Error(ex.StackTrace); return(BadRequest("Invalid GroupId")); } List <Domain.Socioboard.Domain.GroupProfile> lstGroupProfiles = grpProfilesRepo.GetAllGroupProfilesByProfileType(grpId, "linkedin"); List <Domain.Socioboard.Domain.LinkedInAccount> lstLinkedInAccount = new List <Domain.Socioboard.Domain.LinkedInAccount>(); LinkedInAccountRepository _objLinkedInAccountRepository = new LinkedInAccountRepository(); foreach (var profile in lstGroupProfiles) { try { //if (_objLinkedInAccountRepository.checkLinkedinUserExists(profile.ProfileId, Guid.Parse(UserId))) //{ // lstLinkedInAccount.Add(_objLinkedInAccountRepository.getUserInformation(Guid.Parse(UserId), profile.ProfileId)); //} //else //{ lstLinkedInAccount.Add(_objLinkedInAccountRepository.getUserInformation(profile.ProfileId)); //} } catch (Exception ex) { logger.Error(ex.Message); logger.Error(ex.StackTrace); } } return(Ok(lstLinkedInAccount)); }
public IHttpActionResult GetGroupLinkedinProfiles(string GroupId, string UserId) { Guid grpId = Guid.Empty; try { grpId = Guid.Parse(GroupId); } catch (Exception ex) { logger.Error(ex.Message); logger.Error(ex.StackTrace); return BadRequest("Invalid GroupId"); } List<Domain.Socioboard.Domain.GroupProfile> lstGroupProfiles = grpProfilesRepo.GetAllGroupProfilesByProfileType(grpId, "linkedin"); List<Domain.Socioboard.Domain.LinkedInAccount> lstLinkedInAccount = new List<Domain.Socioboard.Domain.LinkedInAccount>(); LinkedInAccountRepository _objLinkedInAccountRepository = new LinkedInAccountRepository(); foreach (var profile in lstGroupProfiles) { try { //if (_objLinkedInAccountRepository.checkLinkedinUserExists(profile.ProfileId, Guid.Parse(UserId))) //{ // lstLinkedInAccount.Add(_objLinkedInAccountRepository.getUserInformation(Guid.Parse(UserId), profile.ProfileId)); //} //else //{ lstLinkedInAccount.Add(_objLinkedInAccountRepository.getUserInformation(profile.ProfileId)); //} } catch (Exception ex) { logger.Error(ex.Message); logger.Error(ex.StackTrace); } } return Ok(lstLinkedInAccount); }
//protected void rbAdmin_CheckedChanged(object sender, EventArgs e) //{ // rbAdmin.Checked = true; // rbUser.Checked = false; // if (rbAdmin.Checked == true && rbUser.Checked == false) // { // AccessLevel = "admin"; // } // else // { // AccessLevel = "user"; // } //} //protected void rbUser_CheckedChanged(object sender, EventArgs e) //{ // rbAdmin.Checked = false; // rbUser.Checked = true; // if (rbAdmin.Checked == false && rbUser.Checked == true) // { // AccessLevel = "user"; // } // else // { // AccessLevel = "admin"; // } //} public void BindSocialProfiles() { User user = (User)Session["LoggedUser"]; if (Session["GroupId"] != null) { Guid groupid = (Guid)Session["GroupId"]; GroupProfileRepository groupprofilesrepo = new GroupProfileRepository(); GroupRepository grouprepo = new GroupRepository(); Groups groups = grouprepo.getGroupDetailsbyId(user.Id, groupid); List <GroupProfile> lstgroupprofile = groupprofilesrepo.getAllGroupProfiles(user.Id, groupid); string bindfacebookprofiles = string.Empty; string bindtwitterprofiles = string.Empty; string bindlinkedinprofiles = string.Empty; string bindinstagramprofiles = string.Empty; string bindtumblrprofiles = string.Empty; int i = 0; foreach (GroupProfile item in lstgroupprofile) { if (item.ProfileType == "facebook") { FacebookAccountRepository fbaccountrepo = new FacebookAccountRepository(); FacebookAccount account = fbaccountrepo.getFacebookAccountDetailsById(item.ProfileId, user.Id); if (account != null) { bindfacebookprofiles += "<div class=\"ws_tm_network_one\"><div class=\"ws_tm_user_name\">" + account.FbUserName + "</div>" + "<div class=\"ws_tm_chkbx\"><input type=\"checkbox\" value=\"facebook_" + item.ProfileId + "\" onclick=\"isProfileID('" + item.ProfileId + "')\" id=\"facebookcheck_" + i + "\" name=\"chkbox_" + i + "\"></div></div>"; } } else if (item.ProfileType == "twitter") { TwitterAccountRepository twtaccountrepo = new TwitterAccountRepository(); TwitterAccount twtaccount = twtaccountrepo.getUserInformation(user.Id, item.ProfileId); if (twtaccount != null) { bindtwitterprofiles += "<div class=\"ws_tm_network_one\"><div class=\"ws_tm_user_name\">" + twtaccount.TwitterScreenName + "</div>" + "<div class=\"ws_tm_chkbx\"><input type=\"checkbox\" value=\"twitter_" + item.ProfileId + "\" onclick=\"isProfileID('" + item.ProfileId + "')\" id=\"twittercheck_" + i + "\" name=\"chkbox_" + i + "\"></div></div>"; } } else if (item.ProfileType == "linkedin") { LinkedInAccountRepository linkedaccrepo = new LinkedInAccountRepository(); LinkedInAccount linkedaccount = linkedaccrepo.getUserInformation(user.Id, item.ProfileId); if (linkedaccount != null) { bindlinkedinprofiles += "<div class=\"ws_tm_network_one\"><div class=\"ws_tm_user_name\">" + linkedaccount.LinkedinUserName + "</div>" + "<div class=\"ws_tm_chkbx\"><input type=\"checkbox\" value=\"linkedin_" + item.ProfileId + "\" onclick=\"isProfileID('" + item.ProfileId + "')\" id=\"linkedincheck_" + i + "\" name=\"chkbox_" + i + "\"></div></div>"; } } else if (item.ProfileType == "tumblr") { TumblrAccountRepository tumblraccrepo = new TumblrAccountRepository(); TumblrAccount tumblraccount = tumblraccrepo.getTumblrAccountDetailsById(item.ProfileId, user.Id); if (tumblraccount != null) { bindtumblrprofiles += "<div class=\"ws_tm_network_one\"><div class=\"ws_tm_user_name\">" + tumblraccount.tblrUserName + "</div>" + "<div class=\"ws_tm_chkbx\"><input type=\"checkbox\" value=\"tumblr_" + item.ProfileId + "\" onclick=\"isProfileID('" + item.ProfileId + "')\" id=\"tumblrcheck_" + i + "\" name=\"chkbox_" + i + "\"></div></div>"; } } else if (item.ProfileType == "instagram") { InstagramAccountRepository instagramrepo = new InstagramAccountRepository(); InstagramAccount instaaccount = instagramrepo.getInstagramAccountDetailsById(item.ProfileId, user.Id); if (instaaccount != null) { bindinstagramprofiles += "<div class=\"ws_tm_network_one\"><div class=\"ws_tm_user_name\">" + instaaccount.InsUserName + "</div>" + "<div class=\"ws_tm_chkbx\"><input type=\"checkbox\" value=\"instagram_" + item.ProfileId + "\" onclick=\"isProfileID('" + item.ProfileId + "')\" id=\"instagramcheck_" + i + "\" name=\"chkbox_" + i + "\"></div></div>"; } } i++; } if (!string.IsNullOrEmpty(bindfacebookprofiles)) { FacebookAc.InnerHtml = bindfacebookprofiles; } else { FacebookAc.InnerHtml = "No Facebook Profiles for " + groups.GroupName + " Group"; } if (!string.IsNullOrEmpty(bindtwitterprofiles)) { TwitterAc.InnerHtml = bindtwitterprofiles; } else { TwitterAc.InnerHtml = "No Twitter Profiles for " + groups.GroupName + " Group"; } if (!string.IsNullOrEmpty(bindinstagramprofiles)) { InstagramAc.InnerHtml = bindinstagramprofiles; } else { InstagramAc.InnerHtml = "No Instagram Profiles for " + groups.GroupName + " Group"; } if (!string.IsNullOrEmpty(bindlinkedinprofiles)) { LinkedInAc.InnerHtml = bindlinkedinprofiles; } else { LinkedInAc.InnerHtml = "No LinkedIn Profiles for " + groups.GroupName + " Group"; } if (!string.IsNullOrEmpty(bindtumblrprofiles)) { TumblrAc.InnerHtml = bindtumblrprofiles; } else { TumblrAc.InnerHtml = "No Tumblr Profiles for " + groups.GroupName + " Group"; } totalaccountscheck.InnerHtml = i.ToString(); } }
public void ProfilesAvailabeforuser(Guid UserId) { string bindprofiles = string.Empty; SocialProfilesRepository socioprofilerepo = new SocialProfilesRepository(); List <SocialProfile> lstsocialprofile = socioprofilerepo.getAllSocialProfilesOfUser(UserId); foreach (SocialProfile item in lstsocialprofile) { if (item.ProfileType == "facebook") { if (!SelectedGroupProfiles.InnerHtml.Contains("facebook_" + item.ProfileId)) { FacebookAccountRepository fbaccreop = new FacebookAccountRepository(); FacebookAccount facebookaccount = fbaccreop.getFacebookAccountDetailsById(item.ProfileId, UserId); bindprofiles += "<div onclick=\"transfertoGroup('facebook','" + item.ProfileId + "')\" id=\"usergroups_" + item.ProfileId + "\" class=\"ws_conct active\"> <span class=\"img\"><img width=\"48\" height=\"48\" src=\"http://graph.facebook.com/" + item.ProfileId + "/picture?type=small\" alt=\"\"><i><img width=\"16\" height=\"16\" src=\"../Contents/img/fb_icon.png\" alt=\"\"></i></span><div class=\"fourfifth\">" + "<div class=\"location-container\">" + facebookaccount.FbUserName + "</div><span class=\"add remove\">✖</span></div></div>"; } } else if (item.ProfileType == "twitter") { if (!SelectedGroupProfiles.InnerHtml.Contains("twitter_" + item.ProfileId)) { string profileimgurl = string.Empty; TwitterAccountRepository twtaccountrepo = new TwitterAccountRepository(); TwitterAccount twtacco = twtaccountrepo.getUserInformation(UserId, item.ProfileId); if (twtacco.ProfileImageUrl == string.Empty) { profileimgurl = "../../Contents/img/blank_img.png"; } else { profileimgurl = twtacco.ProfileImageUrl; } bindprofiles += "<div onclick=\"transfertoGroup('twitter','" + item.ProfileId + "')\" id=\"usergroups_" + item.ProfileId + "\" class=\"ws_conct active\"> <span class=\"img\"><img width=\"48\" height=\"48\" src=\"" + profileimgurl + "\" alt=\"\"><i><img width=\"16\" height=\"16\" src=\"../Contents/img/twticon.png\" alt=\"\"></i></span><div class=\"fourfifth\">" + "<div class=\"location-container\">" + twtacco.TwitterScreenName + "</div><span class=\"add remove\">✖</span></div></div>"; } } else if (item.ProfileType == "linkedin") { if (!SelectedGroupProfiles.InnerHtml.Contains("linkedin_" + item.ProfileId)) { LinkedInAccountRepository linkedaccrepo = new LinkedInAccountRepository(); LinkedInAccount linkedaccount = linkedaccrepo.getUserInformation(UserId, item.ProfileId); string profileimgurl = string.Empty; if (linkedaccount.ProfileUrl == string.Empty) { profileimgurl = "../../Contents/img/blank_img.png"; } else { profileimgurl = linkedaccount.ProfileImageUrl; } bindprofiles += "<div onclick=\"transfertoGroup('linkedin','" + item.ProfileId + "')\" id=\"usergroups_" + item.ProfileId + "\" class=\"ws_conct active\"><span class=\"img\"><img width=\"48\" height=\"48\" alt=\"\" src=\"" + profileimgurl + "\" ><i>" + "<img width=\"16\" height=\"16\" alt=\"\" src=\"../Contents/img/link_icon.png\"></i></span>" + "<div class=\"fourfifth\"><div class=\"location-container\">" + linkedaccount.LinkedinUserName + "</div>" + "<span class=\"add remove\">✖</span></div></div>"; } } else if (item.ProfileType == "instagram") { if (!SelectedGroupProfiles.InnerHtml.Contains("instagram_" + item.ProfileId)) { string profileimgurl = string.Empty; InstagramAccountRepository instagramrepo = new InstagramAccountRepository(); InstagramAccount instaaccount = instagramrepo.getInstagramAccountDetailsById(item.ProfileId, UserId); if (instaaccount.ProfileUrl == string.Empty) { profileimgurl = "../../Contents/img/blank_img.png"; } else { profileimgurl = instaaccount.ProfileUrl; } bindprofiles += "<div onclick=\"transfertoGroup('instagram','" + item.ProfileId + "')\" id=\"usergroups_" + item.ProfileId + "\" class=\"ws_conct active\"><span class=\"img\"><img width=\"48\" height=\"48\" src=\"" + profileimgurl + "\" alt=\"\"><i>" + "<img width=\"16\" height=\"16\" alt=\"\" src=\"../Contents/img/instagram_24X24.png\"></i></span><div class=\"fourfifth\"><div class=\"location-container\">" + instaaccount.InsUserName + "</div>" + "<span class=\"add remove\">✖</span></div></div>"; } } else if (item.ProfileType == "tumblr") { if (!SelectedGroupProfiles.InnerHtml.Contains("tumblr_" + item.ProfileId)) { string profileimgurl = string.Empty; TumblrAccountRepository tumblrrepo = new TumblrAccountRepository(); TumblrAccount tumblraccount = tumblrrepo.getTumblrAccountDetailsById(item.ProfileId, UserId); if (tumblraccount.tblrProfilePicUrl == string.Empty) { profileimgurl = "../../Contents/img/blank_img.png"; } else { profileimgurl = "http://api.tumblr.com/v2/blog/" + tumblraccount.tblrUserName + ".tumblr.com/avatar"; } bindprofiles += "<div onclick=\"transfertoGroup('tumblr','" + item.ProfileId + "')\" id=\"usergroups_" + item.ProfileId + "\" class=\"ws_conct active\"><span class=\"img\"><img width=\"48\" height=\"48\" src=\"http://api.tumblr.com/v2/blog/" + tumblraccount.tblrUserName + ".tumblr.com/avatar\" alt=\"\"><i>" + "<img width=\"16\" height=\"16\" alt=\"\" src=\"../Contents/img/tumblr.png\"></i></span><div class=\"fourfifth\"><div class=\"location-container\">" + tumblraccount.tblrUserName + "</div>" + "<span class=\"add remove\">✖</span></div></div>"; } } } AllGroupProfiles.InnerHtml = bindprofiles; }
public string getLinkedInData(string UserId, string LinkedinId) { string ret = string.Empty; try { Guid userId = Guid.Parse(UserId); //oAuthTwitter OAuth = new oAuthTwitter(ConfigurationManager.AppSettings["consumerKey"], ConfigurationManager.AppSettings["consumerSecret"], ConfigurationManager.AppSettings["callbackurl"]); oAuthLinkedIn Linkedin_Oauth = new oAuthLinkedIn(); Linkedin_Oauth.ConsumerKey = ConfigurationManager.AppSettings["LiApiKey"]; Linkedin_Oauth.ConsumerSecret = ConfigurationManager.AppSettings["LiSecretKey"]; LinkedInAccountRepository objLinkedInAccountRepository = new LinkedInAccountRepository(); LinkedInAccount LinkedAccount; LinkedInAccountRepository linkedinAccRepo = new LinkedInAccountRepository(); if (linkedinAccRepo.checkLinkedinUserExists(LinkedinId, Guid.Parse(UserId))) { LinkedAccount = linkedinAccRepo.getUserInformation(Guid.Parse(UserId), LinkedinId); #region UpdateTeammemberprofile Domain.Socioboard.Domain.TeamMemberProfile objTeamMemberProfile = new Domain.Socioboard.Domain.TeamMemberProfile(); objTeamMemberProfile.ProfileName = LinkedAccount.LinkedinUserName; objTeamMemberProfile.ProfilePicUrl = LinkedAccount.ProfileImageUrl; objTeamMemberProfile.ProfileId = LinkedAccount.LinkedinUserId; objTeamMemberProfileRepository.updateTeamMemberbyprofileid(objTeamMemberProfile); #endregion } else { LinkedAccount = linkedinAccRepo.getUserInformation(LinkedinId); #region UpdateTeammemberprofile Domain.Socioboard.Domain.TeamMemberProfile objTeamMemberProfile = new Domain.Socioboard.Domain.TeamMemberProfile(); objTeamMemberProfile.ProfileName = LinkedAccount.LinkedinUserName; objTeamMemberProfile.ProfilePicUrl = LinkedAccount.ProfileImageUrl; objTeamMemberProfile.ProfileId = LinkedAccount.LinkedinUserId; objTeamMemberProfileRepository.updateTeamMemberbyprofileid(objTeamMemberProfile); #endregion } Linkedin_Oauth.Token = LinkedAccount.OAuthToken; Linkedin_Oauth.TokenSecret = LinkedAccount.OAuthSecret; Linkedin_Oauth.Verifier = LinkedAccount.OAuthVerifier; GetUserProfile(Linkedin_Oauth, LinkedAccount.LinkedinUserId, userId); GetLinkedInFeeds(Linkedin_Oauth, LinkedinId, userId); GetLinkedUserUpdatesNew(Linkedin_Oauth, LinkedinId, userId); return "linkedin Info Updated"; } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } return ret; }
public string ScheduleLinkedinGroupMessage(string scheduledmsgguid, string Userid, string profileid) { string str = string.Empty; try { LinkedInAccount linkacc; string authLink = string.Empty; LinkedInAccountRepository linkedinAccRepo = new LinkedInAccountRepository(); objScheduledMessage = objScheduledMessageRepository.GetScheduledMessageDetails(Guid.Parse(scheduledmsgguid)); GroupScheduleMessageRepository grpschedulemessagerepo = new GroupScheduleMessageRepository(); Domain.Socioboard.Domain.GroupScheduleMessage _GroupScheduleMessage = grpschedulemessagerepo.GetScheduleMessageId(objScheduledMessage.Id); if (linkedinAccRepo.checkLinkedinUserExists(profileid, Guid.Parse(Userid))) { linkacc = linkedinAccRepo.getUserInformation(Guid.Parse(Userid), profileid); } else { linkacc = linkedinAccRepo.getUserInformation(profileid); } oAuthLinkedIn oauthlin = new oAuthLinkedIn(); oauthlin.ConsumerKey = ConfigurationManager.AppSettings["LiApiKey"]; oauthlin.ConsumerSecret = ConfigurationManager.AppSettings["LiSecretKey"]; oauthlin.FirstName = linkacc.LinkedinUserName; oauthlin.Id = linkacc.LinkedinUserId; oauthlin.Token = linkacc.OAuthToken; oauthlin.TokenSecret = linkacc.OAuthSecret; oauthlin.Verifier = linkacc.OAuthVerifier; string imgurl = objScheduledMessage.PicUrl; string text = objScheduledMessage.ShareMessage; string[] arrtext = null; try { arrtext = System.Text.RegularExpressions.Regex.Split(text, "$%^_^%$"); if (arrtext.Count() == 1) { arrtext = null; arrtext = text.Split(new string[] { "$%^_^%$" }, StringSplitOptions.None); } } catch (Exception ex) { return "somthing went wrong"; } string Title = arrtext[0]; string Message = arrtext[1]; string response = string.Empty; if (linkacc != null) { try { if (string.IsNullOrEmpty(objScheduledMessage.ShareMessage) && string.IsNullOrEmpty(objScheduledMessage.PicUrl)) { str = "There is no data in Share Message !"; } else { SocialStream sociostream = new SocialStream(); if (!string.IsNullOrEmpty(imgurl)) { imgurl = ConfigurationManager.AppSettings["DomainName"].ToString() + Regex.Split(imgurl, "wwwroot")[1].Replace("\\", "/"); response = sociostream.SetImagePostUpdate(oauthlin, _GroupScheduleMessage.GroupId, Message, Title, imgurl); } else { response = sociostream.SetPostUpdate(oauthlin, _GroupScheduleMessage.GroupId, Message, Title); } } } catch (Exception ex) { } str = "Message post on linkedingroup for Id :" + linkacc.LinkedinUserId + ", Title: " + Title + " and Message: " + Message; ScheduledMessage schmsg = new ScheduledMessage(); schmsg.UpdateScheduledMessageByMsgId(Guid.Parse(scheduledmsgguid)); } } catch (Exception ex) { Console.WriteLine(ex.Message); str = ex.Message; } return str; }
public string LinkedinProfileDetails(string Userid, string ProfileId) { Domain.Socioboard.Domain.LinkedInAccount objLinkedinAccount = new Domain.Socioboard.Domain.LinkedInAccount(); LinkedInAccountRepository _objLinkedInAccountRepository = new LinkedInAccountRepository(); if (_objLinkedInAccountRepository.checkLinkedinUserExists(ProfileId, Guid.Parse(Userid))) { objLinkedinAccount = _objLinkedInAccountRepository.getUserInformation(Guid.Parse(Userid), ProfileId); } else { objLinkedinAccount = _objLinkedInAccountRepository.getUserInformation(ProfileId); } return new JavaScriptSerializer().Serialize(objLinkedinAccount); }
public string LinkedinComposeMessage(String message, String profileid, string userid, string currentdatetime, string picurl) { string ret = ""; LinkedInAccount LinkedAccount; string authLink = string.Empty; LinkedInAccountRepository linkedinAccRepo = new LinkedInAccountRepository(); if (linkedinAccRepo.checkLinkedinUserExists(profileid, Guid.Parse(userid))) { LinkedAccount = linkedinAccRepo.getUserInformation(Guid.Parse(userid), profileid); } else { LinkedAccount = linkedinAccRepo.getUserInformation(profileid); } oAuthLinkedIn Linkedin_oauth = new oAuthLinkedIn(); Linkedin_oauth.Verifier = LinkedAccount.OAuthVerifier; Linkedin_oauth.TokenSecret = LinkedAccount.OAuthSecret; Linkedin_oauth.Token = LinkedAccount.OAuthToken; Linkedin_oauth.Id = LinkedAccount.LinkedinUserId; Linkedin_oauth.FirstName = LinkedAccount.LinkedinUserName; SocialStream sociostream = new SocialStream(); try { if (!string.IsNullOrEmpty(picurl)) { picurl = ConfigurationManager.AppSettings["DomainName"].ToString() + Regex.Split(picurl, "wwwroot")[1].Replace("\\", "/"); string res = sociostream.SetImageStatusUpdate(Linkedin_oauth, message, picurl); } else { string res = sociostream.SetStatusUpdate(Linkedin_oauth, message); } ret = "success"; } catch (Exception ex) { logger.Error(ex.Message); ret = "failuer"; } //string res = sociostream.SetStatusUpdate(Linkedin_oauth, message); return ret; }
public string PostLinkedInGroupFeeds(string gid, string linkedInUserId, string msg, string title, string userid) { LinkedInAccount linkacc; string authLink = string.Empty; LinkedInAccountRepository linkedinAccRepo = new LinkedInAccountRepository(); if (linkedinAccRepo.checkLinkedinUserExists(linkedInUserId, Guid.Parse(userid))) { linkacc = linkedinAccRepo.getUserInformation(Guid.Parse(userid), linkedInUserId); } else { linkacc = linkedinAccRepo.getUserInformation(linkedInUserId); } oAuthLinkedIn oauthlin = new oAuthLinkedIn(); oauthlin.ConsumerKey = ConfigurationManager.AppSettings["LiApiKey"]; oauthlin.ConsumerSecret = ConfigurationManager.AppSettings["LiSecretKey"]; oauthlin.FirstName = linkacc.LinkedinUserName; oauthlin.Id = linkacc.LinkedinUserId; oauthlin.Token = linkacc.OAuthToken; oauthlin.TokenSecret = linkacc.OAuthSecret; oauthlin.Verifier = linkacc.OAuthVerifier; GlobusLinkedinLib.LinkedIn.Core.SocialStreamMethods.SocialStream l = new GlobusLinkedinLib.LinkedIn.Core.SocialStreamMethods.SocialStream(); string status = l.SetPostUpdate(oauthlin, gid, msg, title); return "success"; }
public string FollowLinkedinPost(string GpPostid, string LinkedinUserId, string isFollowing, string userid) { int Following = Convert.ToInt32(isFollowing); string FollowStatus = string.Empty; if (Following == 0) { FollowStatus = "true"; } else { FollowStatus = "false"; } LinkedInAccount linkacc; string authLink = string.Empty; LinkedInAccountRepository linkedinAccRepo = new LinkedInAccountRepository(); if (linkedinAccRepo.checkLinkedinUserExists(LinkedinUserId, Guid.Parse(userid))) { linkacc = linkedinAccRepo.getUserInformation(Guid.Parse(userid), LinkedinUserId); } else { linkacc = linkedinAccRepo.getUserInformation(LinkedinUserId); } oAuthLinkedIn oauthlin = new oAuthLinkedIn(); oauthlin.ConsumerKey = ConfigurationManager.AppSettings["LiApiKey"]; oauthlin.ConsumerSecret = ConfigurationManager.AppSettings["LiSecretKey"]; oauthlin.FirstName = linkacc.LinkedinUserName; oauthlin.Id = linkacc.LinkedinUserId; oauthlin.Token = linkacc.OAuthToken; oauthlin.TokenSecret = linkacc.OAuthSecret; oauthlin.Verifier = linkacc.OAuthVerifier; GlobusLinkedinLib.LinkedIn.Core.SocialStreamMethods.SocialStream l = new GlobusLinkedinLib.LinkedIn.Core.SocialStreamMethods.SocialStream(); string status = l.SetFollowCountUpdate(oauthlin, GpPostid, FollowStatus); return "success"; }
public string GetLinkedGroupsDataDetail(string userid,string groupid, string linkedinId) { LinkedInAccount linkacc; string authLink = string.Empty; LinkedInAccountRepository linkedinAccRepo = new LinkedInAccountRepository(); if (linkedinAccRepo.checkLinkedinUserExists(linkedinId, Guid.Parse(userid))) { linkacc = linkedinAccRepo.getUserInformation(Guid.Parse(userid), linkedinId); } else { linkacc = linkedinAccRepo.getUserInformation(linkedinId); } // LinkedInAccount linkacc = linkedinAccRepo.getUserInformation(Guid.Parse(userid), linkedinId); oAuthLinkedIn oauthlin = new oAuthLinkedIn(); oauthlin.ConsumerKey = ConfigurationManager.AppSettings["LiApiKey"]; oauthlin.ConsumerSecret = ConfigurationManager.AppSettings["LiSecretKey"]; oauthlin.FirstName = linkacc.LinkedinUserName; oauthlin.Id = linkacc.LinkedinUserId; oauthlin.Token = linkacc.OAuthToken; oauthlin.TokenSecret = linkacc.OAuthSecret; oauthlin.Verifier = linkacc.OAuthVerifier; GlobusLinkedinLib.App.Core.LinkedInGroup l = new GlobusLinkedinLib.App.Core.LinkedInGroup(); List<Domain.Socioboard.Domain.LinkedInGroup.Group_Updates> lst = l.GetGroupPostData(oauthlin, 20, groupid, linkedinId); return new JavaScriptSerializer().Serialize(lst); }
public string GetLinkedUserUpdates(string profileid, string UserId) { System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls; LinkedInAccount linkacc; string authLink = string.Empty; LinkedInAccountRepository linkedinAccRepo = new LinkedInAccountRepository(); if (linkedinAccRepo.checkLinkedinUserExists(profileid, Guid.Parse(UserId))) { linkacc = linkedinAccRepo.getUserInformation(Guid.Parse(UserId), profileid); } else { linkacc = linkedinAccRepo.getUserInformation(profileid); } oAuthLinkedIn oauthlin = new oAuthLinkedIn(); oauthlin.ConsumerKey = ConfigurationManager.AppSettings["LinkedinApiKey"]; oauthlin.ConsumerSecret = ConfigurationManager.AppSettings["LinkedinSecretKey"]; oauthlin.FirstName = linkacc.LinkedinUserName; oauthlin.Id = linkacc.LinkedinUserId; oauthlin.Token = linkacc.OAuthToken; oauthlin.TokenSecret = linkacc.OAuthSecret; oauthlin.Verifier = linkacc.OAuthVerifier; GlobusLinkedinLib.App.Core.LinkedInUser l = new GlobusLinkedinLib.App.Core.LinkedInUser(); List<Domain.Socioboard.Domain.LinkedInUser.User_Updates> lst = l.GetUserUpdate(oauthlin, linkacc.LinkedinUserId, 10); return new JavaScriptSerializer().Serialize(lst); }
public string LinkedinComposeMessageRss(string message, string profileid, string userid) { string ret = ""; LinkedInAccount LinkedAccount; string authLink = string.Empty; LinkedInAccountRepository linkedinAccRepo = new LinkedInAccountRepository(); if (linkedinAccRepo.checkLinkedinUserExists(profileid, Guid.Parse(userid))) { LinkedAccount = linkedinAccRepo.getUserInformation(Guid.Parse(userid), profileid); } else { LinkedAccount = linkedinAccRepo.getUserInformation(profileid); } oAuthLinkedIn Linkedin_oauth = new oAuthLinkedIn(); Linkedin_oauth.Verifier = LinkedAccount.OAuthVerifier; Linkedin_oauth.TokenSecret = LinkedAccount.OAuthSecret; Linkedin_oauth.Token = LinkedAccount.OAuthToken; Linkedin_oauth.Id = LinkedAccount.LinkedinUserId; Linkedin_oauth.FirstName = LinkedAccount.LinkedinUserName; SocialStream sociostream = new SocialStream(); try { ret = sociostream.SetStatusUpdate(Linkedin_oauth, message); RssFeedsRepository objrssfeed = new RssFeedsRepository(); objrssfeed.updateFeedStatus(Guid.Parse(userid), message); return ret = "Messages Posted Successfully"; } catch (Exception ex) { Console.WriteLine(ex.Message); return ret = "Message Could Not Posted"; } }
public string SheduleLinkedInMessage(string LinkedInId, string UserId, string sscheduledmsgguid) { string str = string.Empty; LinkedInAccount LinkedAccount; string authLink = string.Empty; LinkedInAccountRepository linkedinAccRepo = new LinkedInAccountRepository(); try { objScheduledMessage = objScheduledMessageRepository.GetScheduledMessageDetails(Guid.Parse(sscheduledmsgguid)); if (linkedinAccRepo.checkLinkedinUserExists(LinkedInId, Guid.Parse(UserId))) { LinkedAccount = linkedinAccRepo.getUserInformation(Guid.Parse(UserId), LinkedInId); } else { LinkedAccount = linkedinAccRepo.getUserInformation(LinkedInId); } oAuthLinkedIn Linkedin_oauth = new oAuthLinkedIn(); Linkedin_oauth.ConsumerKey = System.Configuration.ConfigurationSettings.AppSettings["LiApiKey"].ToString(); Linkedin_oauth.ConsumerSecret = System.Configuration.ConfigurationSettings.AppSettings["LiSecretKey"].ToString(); Linkedin_oauth.FirstName = LinkedAccount.LinkedinUserName; Linkedin_oauth.Token = LinkedAccount.OAuthToken; Linkedin_oauth.TokenSecret = LinkedAccount.OAuthSecret; Linkedin_oauth.Verifier = LinkedAccount.OAuthVerifier; string message = objScheduledMessage.ShareMessage; string picurl = objScheduledMessage.PicUrl; if (LinkedAccount != null) { try { //GlobusLinkedinLib.App.Core.LinkedInUser linkeduser = new GlobusLinkedinLib.App.Core.LinkedInUser(); if (string.IsNullOrEmpty(objScheduledMessage.ShareMessage) && string.IsNullOrEmpty(objScheduledMessage.PicUrl)) { //objScheduledMessage.ShareMessage = "There is no data in Share Message !"; str = "There is no data in Share Message !"; } else { var response = string.Empty; ; try { //response = linkeduser.SetStatusUpdate(Linkedin_oauth, objScheduledMessage.ShareMessage); SocialStream sociostream = new SocialStream(); if (!string.IsNullOrEmpty(picurl)) { picurl = ConfigurationManager.AppSettings["DomainName"].ToString() + Regex.Split(picurl, "wwwroot")[1].Replace("\\", "/"); response = sociostream.SetImageStatusUpdate(Linkedin_oauth, message, picurl); } else { response = sociostream.SetStatusUpdate(Linkedin_oauth, message); } } catch (Exception ex) { Console.WriteLine(ex.StackTrace); str = ex.Message; } if (!string.IsNullOrEmpty(response)) { str = "Message post on linkedin for Id :" + LinkedAccount.LinkedinUserId + " and Message: " + objScheduledMessage.ShareMessage; ScheduledMessage schmsg = new ScheduledMessage(); schmsg.UpdateScheduledMessageByMsgId(Guid.Parse(sscheduledmsgguid)); } else { str = "Message not posted"; } } } catch (Exception ex) { Console.WriteLine(ex.StackTrace); str = ex.Message; } } else { str = "Linkedin account not found for id" + objScheduledMessage.ProfileId; } } catch (Exception ex) { Console.WriteLine(ex.StackTrace); str = ex.Message; } return str; }
public void ProcessRequest() { TeamRepository objTeamRepository = new TeamRepository(); TeamMemberProfileRepository objTeamMemberProfileRepository = new TeamMemberProfileRepository(); FacebookAccountRepository fbaccountrepo = new FacebookAccountRepository(); TwitterAccountRepository twtaccountrepo = new TwitterAccountRepository(); LinkedInAccountRepository linkedaccrepo = new LinkedInAccountRepository(); InstagramAccountRepository instagramrepo = new InstagramAccountRepository(); GroupProfileRepository groupprofilerepo = new GroupProfileRepository(); BusinessSettingRepository objbsnsrepo = new BusinessSettingRepository(); TumblrAccountRepository tumblrrepo = new TumblrAccountRepository(); User user = (User)Session["LoggedUser"]; if (Request.QueryString["op"] != null) { if (Request.QueryString["op"] == "SaveGroupName") { string groupName = Request.QueryString["groupname"]; GroupRepository grouprepo = new GroupRepository(); Groups group = new Groups(); group.Id = Guid.NewGuid(); group.GroupName = groupName; group.UserId = user.Id; group.EntryDate = DateTime.Now; if (!grouprepo.checkGroupExists(user.Id, groupName)) { grouprepo.AddGroup(group); Groups grou = grouprepo.getGroupDetails(user.Id, groupName); Session["GroupName"] = grou; } else { Groups grou = grouprepo.getGroupDetails(user.Id, groupName); Session["GroupName"] = grou; } } else if (Request.QueryString["op"] == "bindGroupProfiles") { string bindprofiles = string.Empty; Guid groupid = Guid.Parse(Request.QueryString["groupId"]); Session["GroupId"] = groupid; GroupProfileRepository groupprofilesrepo = new GroupProfileRepository(); List <GroupProfile> lstgroupprofile = groupprofilesrepo.getAllGroupProfiles(user.Id, groupid); foreach (GroupProfile item in lstgroupprofile) { if (item.ProfileType == "facebook") { FacebookAccount account = fbaccountrepo.getFacebookAccountDetailsById(item.ProfileId, user.Id); if (account != null) { bindprofiles += "<div id=\"facebook_" + item.ProfileId + "\" class=\"ws_conct\"> <span class=\"img\"><img width=\"48\" height=\"48\" src=\"http://graph.facebook.com/" + item.ProfileId + "/picture?type=small\" alt=\"\"><i><img width=\"16\" height=\"16\" src=\"../Contents/img/fb_icon.png\" alt=\"\"></i></span><div class=\"fourfifth\">" + "<div class=\"location-container\">" + account.FbUserName + "</div><span onclick=\"AddProfileInInviteTeamMember('" + account.FbUserId + "','" + groupid + "','" + item.ProfileType + "')\" class=\"add remove\">+</span><span onclick=\"RemoveProfileFromGroup('" + item.ProfileId + "')\" class=\"add remove\">✖</span></div></div>"; } } else if (item.ProfileType == "twitter") { TwitterAccount twtaccount = twtaccountrepo.getUserInformation(user.Id, item.ProfileId); string profileimgurl = string.Empty; if (twtaccount != null) { if (twtaccount.ProfileImageUrl == string.Empty) { profileimgurl = "../../Contents/img/blank_img.png"; } else { profileimgurl = twtaccount.ProfileImageUrl; } bindprofiles += "<div id=\"twitter_" + item.ProfileId + "\" class=\"ws_conct active\"> <span class=\"img\"><img width=\"48\" height=\"48\" src=\"" + profileimgurl + "\" alt=\"\"><i><img width=\"16\" height=\"16\" src=\"../Contents/img/twticon.png\" alt=\"\"></i></span><div class=\"fourfifth\">" + "<div class=\"location-container\">" + twtaccount.TwitterScreenName + "</div><span onclick=\"AddProfileInInviteTeamMember('" + twtaccount.TwitterUserId + "','" + groupid + "','" + item.ProfileType + "')\" class=\"add remove\">+</span><span onclick=\"RemoveProfileFromGroup('" + item.ProfileId + "')\" class=\"add remove\">✖</span></div></div>"; } } else if (item.ProfileType == "linkedin") { LinkedInAccount linkedaccount = linkedaccrepo.getUserInformation(user.Id, item.ProfileId); string profileimgurl = string.Empty; if (linkedaccount != null) { if (linkedaccount.ProfileUrl == string.Empty) { profileimgurl = "../../Contents/img/blank_img.png"; } else { profileimgurl = linkedaccount.ProfileImageUrl; } bindprofiles += "<div id=\"linkedin_" + item.ProfileId + "\" class=\"ws_conct active\"><span class=\"img\"><img width=\"48\" height=\"48\" alt=\"\" src=\"" + profileimgurl + "\" ><i>" + "<img width=\"16\" height=\"16\" alt=\"\" src=\"../Contents/img/link_icon.png\"></i></span>" + "<div class=\"fourfifth\"><div class=\"location-container\">" + linkedaccount.LinkedinUserName + "</div>" + "<span onclick=\"AddProfileInInviteTeamMember('" + linkedaccount.LinkedinUserId + "','" + groupid + "','" + item.ProfileType + "')\" class=\"add remove\">+</span><span onclick=\"RemoveProfileFromGroup('" + item.ProfileId + "')\" class=\"add remove\">✖</span></div></div>"; } } else if (item.ProfileType == "tumblr") { TumblrAccount tumblraccount = tumblrrepo.getTumblrAccountDetailsById(item.ProfileId, user.Id); string profileimgurl = string.Empty; if (tumblraccount != null) { if (tumblraccount.tblrProfilePicUrl == string.Empty) { profileimgurl = "../../Contents/img/blank_img.png"; } else { profileimgurl = "http://api.tumblr.com/v2/blog/" + tumblraccount.tblrUserName + ".tumblr.com/avatar"; } bindprofiles += "<div id=\"tumblr_" + item.ProfileId + "\" class=\"ws_conct active\"><span class=\"img\"><img width=\"48\" height=\"48\" alt=\"\" src=\"http://api.tumblr.com/v2/blog/" + tumblraccount.tblrUserName + ".tumblr.com/avatar\" ><i>" + "<img width=\"16\" height=\"16\" alt=\"\" src=\"../Contents/img/tumblr.png\"></i></span>" + "<div class=\"fourfifth\"><div class=\"location-container\">" + tumblraccount.tblrUserName + "</div>" + "<span onclick=\"AddProfileInInviteTeamMember('" + tumblraccount.tblrUserName + "','" + groupid + "','" + item.ProfileType + "')\" class=\"add remove\">+</span><span onclick=\"RemoveProfileFromGroup('" + item.ProfileId + "')\" class=\"add remove\">✖</span></div></div>"; } } else if (item.ProfileType == "instagram") { string profileimgurl = string.Empty; InstagramAccount instaaccount = instagramrepo.getInstagramAccountDetailsById(item.ProfileId, user.Id); if (instaaccount != null) { if (instaaccount.ProfileUrl == string.Empty) { profileimgurl = "../../Contents/img/blank_img.png"; } else { profileimgurl = instaaccount.ProfileUrl; } bindprofiles += "<div id=\"instagram_" + item.ProfileId + "\" class=\"ws_conct active\"><span class=\"img\"><img width=\"48\" height=\"48\" src=\"" + profileimgurl + "\" alt=\"\"><i>" + "<img width=\"16\" height=\"16\" alt=\"\" src=\"../Contents/img/instagram_24X24.png\"></i></span><div class=\"fourfifth\"><div class=\"location-container\">" + instaaccount.InsUserName + "</div>" + "<span onclick=\"AddProfileInInviteTeamMember('" + instaaccount.InstagramId + "','" + groupid + "','" + item.ProfileType + "')\" class=\"add remove\">+</span><span onclick=\"RemoveProfileFromGroup('" + item.ProfileId + "')\" class=\"add remove\">✖</span></div></div>"; } } } Response.Write(bindprofiles); } else if (Request.QueryString["op"] == "deleteGroupName") { Guid groupid = Guid.Parse(Request.QueryString["groupId"]); GroupRepository grouprepo = new GroupRepository(); grouprepo.DeleteGroup(groupid); int count = groupprofilerepo.DeleteAllGroupProfile(groupid); int cnt = objbsnsrepo.DeleteBusinessSettingByUserid(groupid); List <Team> objTeamId = objTeamRepository.getAllDetailsUserEmail(groupid); foreach (Team item in objTeamId) { int deteleTeamMember = objTeamMemberProfileRepository.deleteTeamMember(item.Id); } int deleteTeam = objTeamRepository.deleteGroupRelatedTeam(groupid); } else if (Request.QueryString["op"] == "addProfilestoGroup") { string network = Request.QueryString["network"]; string id = Request.QueryString["profileid"]; Guid groupid = (Guid)Session["GroupId"]; GroupProfile groupprofile = new GroupProfile(); groupprofile.EntryDate = DateTime.Now; groupprofile.GroupId = groupid; groupprofile.Id = Guid.NewGuid(); groupprofile.ProfileId = id; groupprofile.ProfileType = network; groupprofile.GroupOwnerId = user.Id; GroupProfileRepository grouprepo = new GroupProfileRepository(); if (!grouprepo.checkGroupProfileExists(user.Id, groupid, id)) { grouprepo.AddGroupProfile(groupprofile); } Response.Write(groupid); } else if (Request.QueryString["op"] == "deleteGroupProfiles") { Guid groupid = (Guid)Session["GroupId"]; try { string profileid = Request.QueryString["profileid"]; GroupProfileRepository grouprepo = new GroupProfileRepository(); grouprepo.DeleteGroupProfile(user.Id, profileid, groupid); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } Response.Write(groupid); } if (Request.QueryString["op"] == "GetInviteMember") { string bindprofiles = string.Empty; string profileimgurl = string.Empty; try { string gp = Request.QueryString["groupId"]; Guid GroupId = Guid.Parse(gp); // TeamRepository objTeamRepository = new TeamRepository(); List <Team> objTeam = objTeamRepository.getAllDetailsUserEmail(GroupId); if (objTeam.Count != 0) { foreach (Team item in objTeam) { UserRepository objUserRepository = new UserRepository(); User ObjUserDetails = objUserRepository.getUserInfoByEmail(item.EmailId); if (ObjUserDetails != null) { if (string.IsNullOrEmpty(ObjUserDetails.ProfileUrl)) { profileimgurl = "../../Contents/img/blank_img.png"; } else { profileimgurl = ObjUserDetails.ProfileUrl; } bindprofiles += "<div style=\"float:left; margin-right:18%\"id=\"" + item.Id + "\">" + "<div style=\"float:left\"><span class=\"img\"><img width=\"48\" height=\"48\" src=\"" + profileimgurl + "\" alt=\"\"></span>" + "</div><div style=\"float:left\" class=\"fourfifth\"><div style=\"font-size:small \">" + ObjUserDetails.UserName + "</div> </div><div style=\"float:left;margin-left:3px\" onclick=\"ShowInviteMemberProfileDetails('" + GroupId + "','" + ObjUserDetails.EmailId + "','" + user.Id + "')\"><input class=\"abc\" type=\"radio\" name=\"sex\" value=" + item.Id + "></div>" + "<span onclick=\"RemoveInviteMemberFromGroup('" + item.Id + "')\" style=\"margin-left:25px;font-size:small;cursor:pointer;position: absolute; margin-top: 28px;margin-left:10px\">x</span></div>"; //bindprofiles += "<div id=\"" + item.Id + "\" class=\"ws_conct active\"> <span class=\"img\"><img width=\"48\" height=\"48\" src=\"" + profileimgurl + "\" alt=\"\"><i><img width=\"16\" height=\"16\" src=\"../Contents/img/twticon.png\" alt=\"\"></i></span><div class=\"fourfifth\">" + // "<div class=\"location-container\">" + ObjUserDetails.UserName + "</div><span class=\"add remove\" onclick=\"ShowInviteMemberProfileDetails('" + GroupId + "','" + ObjUserDetails.EmailId + "','" + user.Id + "')\"><input class=\"abc\" type=\"radio\" name=\"sex\" value=" + item.Id + "></span><span onclick=\"RemoveInviteMemberFromGroup('" + item.Id + "')\" class=\"add remove\">✖</span></div></div>"; } } } Response.Write(bindprofiles); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } } if (Request.QueryString["op"] == "RemoveInviteMemberFromGroup") { if (!string.IsNullOrEmpty(Request.QueryString["Id"])) { try { string ide = Request.QueryString["Id"]; Guid id = Guid.Parse(ide); int deleteTeam = objTeamRepository.deleteinviteteamMember(id); int deleteProfiles = objTeamMemberProfileRepository.DeleteTeamMemberProfileByTeamId(id); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } } } //modified by hozefa 4-7-2014 if (Request.QueryString["op"] == "ShowInviteMemberProfileDetails") { string bindprofiles = string.Empty; string gpId = Request.QueryString["groupId"]; Guid gpid = Guid.Parse(gpId); string emailId = Request.QueryString["emailid"]; string userId = Request.QueryString["userid"]; Team teamdata = objTeamRepository.getAllDetails(gpid, emailId); List <TeamMemberProfile> objTeamMemProfile = objTeamMemberProfileRepository.getAllTeamMemberProfilesOfTeam(teamdata.Id); try { foreach (TeamMemberProfile item in objTeamMemProfile) { if (item.ProfileType == "facebook") { FacebookAccount account = fbaccountrepo.getFacebookAccountDetailsById(item.ProfileId); if (account != null) { bindprofiles += "<div id=\"item\" style=\"float:left;width:170px;margin-top:6px\" id=\"facebook_" + item.ProfileId + "\"><div style=\"float:left\"<span class=\"img\">" + "<img width=\"48\" height=\"48\" src=\"http://graph.facebook.com/" + item.ProfileId + "/picture?type=small\" alt=\"\"></img><i><img style=\"margin-left:-18px\" width=\"16\" height=\"16\" src=\"../Contents/img/fb_icon.png\" alt=\"\"></img></i>" + "</span></div><div style=\"float:left\"><div style=\"font-size:small\">" + account.FbUserName + "</div></div>" + "<span onclick=\"RemoveInviteMemberProfileFromTeamMember('" + teamdata.Id + "','" + item.ProfileId + "','" + gpId + "','" + emailId + "','" + userId + "')\" style=\"margin-left:25px;font-size:small;cursor:pointer;position: absolute; margin-top: 28px;margin-left:10px\">x</span></div>"; } } else if (item.ProfileType == "twitter") { TwitterAccount twtaccount = twtaccountrepo.getUserInformation(item.ProfileId); string profileimgurl = string.Empty; if (twtaccount != null) { if (twtaccount.ProfileImageUrl == string.Empty) { profileimgurl = "../../Contents/img/blank_img.png"; } else { profileimgurl = twtaccount.ProfileImageUrl; } bindprofiles += "<div id=\"item\" style=\"float:left; width:170px;margin-top:6px\" id=\"twitter_" + item.ProfileId + "\"><div style=\"float:left\"<span class=\"img\">" + "<img width=\"48\" height=\"48\" src=\"" + profileimgurl + "\" alt=\"\"></img><i><img style=\"margin-left:-18px\" width=\"16\" height=\"16\" src=\"../Contents/img/twticon.png\" alt=\"\"></img></i>" + "</span></div><div style=\"float:left\"><div style=\"font-size:small\">" + twtaccount.TwitterScreenName + "</div></div>" + "<span onclick=\"RemoveInviteMemberProfileFromTeamMember('" + teamdata.Id + "','" + item.ProfileId + "','" + gpId + "','" + emailId + "','" + userId + "')\" style=\"margin-left:25px;font-size:small;cursor:pointer;position: absolute; margin-top: 28px;margin-left:10px\">x</span></div>"; } } else if (item.ProfileType == "linkedin") { LinkedInAccount linkedaccount = linkedaccrepo.getUserInformation(item.ProfileId); string profileimgurl = string.Empty; if (linkedaccount != null) { if (linkedaccount.ProfileUrl == string.Empty) { profileimgurl = "../../Contents/img/blank_img.png"; } else { profileimgurl = linkedaccount.ProfileImageUrl; } bindprofiles += "<div id=\"item\" style=\"float:left;width:170px;margin-top:6px\" id=\"linkedin_" + item.ProfileId + "\"><div style=\"float:left\"<span class=\"img\">" + "<img width=\"48\" height=\"48\" src=\"" + profileimgurl + "\" alt=\"\"></img><i><img style=\"margin-left:-18px\" width=\"16\" height=\"16\" src=\"../Contents/img/link_icon.png\" alt=\"\"></img></i>" + "</span></div><div style=\"float:left\"><div style=\"font-size:small\">" + linkedaccount.LinkedinUserName + "</div></div>" + "<span onclick=\"RemoveInviteMemberProfileFromTeamMember('" + teamdata.Id + "','" + item.ProfileId + "','" + gpId + "','" + emailId + "','" + userId + "')\" style=\"margin-left:25px;font-size:small;cursor:pointer;position: absolute; margin-top: 28px;margin-left:10px\">x</span></div>"; } } else if (item.ProfileType == "instagram") { string profileimgurl = string.Empty; InstagramAccount instaaccount = instagramrepo.getInstagramAccountDetailsById(item.ProfileId); if (instaaccount != null) { if (instaaccount.ProfileUrl == string.Empty) { profileimgurl = "../../Contents/img/blank_img.png"; } else { profileimgurl = instaaccount.ProfileUrl; } bindprofiles += "<div id=\"item\" style=\"float:left;width:170px; margin-top:6px\" id=\"instagram_" + item.ProfileId + "\"><div style=\"float:left\"<span class=\"img\">" + "<img width=\"48\" height=\"48\" src=\"" + profileimgurl + "\" alt=\"\"></img><i><img style=\"margin-left:-18px\" width=\"16\" height=\"16\" src=\"../Contents/img/instagram_24X24.png\" alt=\"\"></img></i>" + "</span></div><div style=\"float:left\"><div style=\"font-size:small\">" + instaaccount.InsUserName + "</div></div>" + "<span onclick=\"RemoveInviteMemberProfileFromTeamMember('" + teamdata.Id + "','" + item.ProfileId + "','" + gpId + "','" + emailId + "','" + userId + "')\" style=\"margin-left:25px;font-size:small;cursor:pointer;position: absolute; margin-top: 28px;margin-left:10px\">x</span></div>"; } } else if (item.ProfileType == "tumblr") { string profileimgurl = string.Empty; TumblrAccount tumblraccount = tumblrrepo.getTumblrAccountDetailsById(item.ProfileId); if (tumblraccount != null) { if (tumblraccount.tblrProfilePicUrl == string.Empty) { profileimgurl = "../../Contents/img/blank_img.png"; } else { profileimgurl = "http://api.tumblr.com/v2/blog/" + tumblraccount.tblrUserName + ".tumblr.com/avatar"; } bindprofiles += "<div id=\"item\" style=\"float:left;width:170px; margin-top:6px\" id=\"tumblr_" + item.ProfileId + "\"><div style=\"float:left\"<span class=\"img\">" + "<img width=\"48\" height=\"48\" src=\"" + profileimgurl + "\" alt=\"\"></img><i><img style=\"margin-left:-18px\" width=\"16\" height=\"16\" src=\"../Contents/img/tumblr.png\" alt=\"\"></img></i>" + "</span></div><div style=\"float:left\"><div style=\"font-size:small\">" + tumblraccount.tblrUserName + "</div></div>" + "<span onclick=\"RemoveInviteMemberProfileFromTeamMember('" + teamdata.Id + "','" + item.ProfileId + "','" + gpId + "','" + emailId + "','" + userId + "')\" style=\"margin-left:25px;font-size:small;cursor:pointer;position: absolute; margin-top: 28px;margin-left:10px\">x</span></div>"; } } } } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } Response.Write(bindprofiles); } if (Request.QueryString["op"] == "RemoveInviteMemberProfileFromTeamMember") { string profileId = Request.QueryString["ProfileId"]; Guid teamid = Guid.Parse(Request.QueryString["TeamId"]); try { int deleteTeamMembeProfile = objTeamMemberProfileRepository.DeleteTeamMemberProfileByTeamIdProfileId(profileId, teamid); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } } if (Request.QueryString["op"] == "AddProfileInInviteTeamMember") { try { string EmailId = string.Empty; string Result = string.Empty; TeamMemberProfile objteam = new TeamMemberProfile(); objteam.ProfileId = Request.QueryString["Profileid"]; objteam.ProfileType = Request.QueryString["Profiletype"]; string GrpId = Request.QueryString["Groupid"]; Guid grpid = Guid.Parse(GrpId); TeamRepository objTeamrepo = new TeamRepository(); Team team = new Team(); Guid id = Guid.NewGuid(); objteam.Id = id; string teamid = Request.QueryString["Teamid"]; objteam.TeamId = Guid.Parse(teamid); objteam.StatusUpdateDate = DateTime.Now; objteam.Status = 0; team = objTeamrepo.getAllDetailsByTeamID(objteam.TeamId, grpid); EmailId = team.EmailId; try { if (!objTeamMemberProfileRepository.checkTeamMemberProfile(objteam.TeamId, objteam.ProfileId)) { objTeamMemberProfileRepository.addNewTeamMember(objteam); Result = "Success"; } else { //ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('This Profile Already Added.');", true); Result = "Fail"; } } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } Response.Write(Result + "_" + EmailId); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } } } }