Ejemplo n.º 1
0
        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.Myfashion.Domain.LinkedInGroup.Group_Updates> lst = l.GetGroupPostData(oauthlin, 20, groupid, linkedinId);

            return(new JavaScriptSerializer().Serialize(lst));
        }
Ejemplo n.º 2
0
        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");
        }
Ejemplo n.º 3
0
        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["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.LinkedInUser l = new GlobusLinkedinLib.App.Core.LinkedInUser();
            List <Domain.Myfashion.Domain.LinkedInUser.User_Updates> lst = l.GetUserUpdate(oauthlin, linkacc.LinkedinUserId, 10);

            return(new JavaScriptSerializer().Serialize(lst));
        }
Ejemplo n.º 4
0
 public string GetAllLinkedinAccountsByUserIdAndGroupId(string userid, string groupid)
 {
     try
     {
         LinkedInAccountRepository _objLinkedInAccountRepository           = new LinkedInAccountRepository();
         List <Domain.Myfashion.Domain.LinkedInAccount> lstLinkedInAccount = new List <Domain.Myfashion.Domain.LinkedInAccount>();
         Domain.Myfashion.Domain.Team objTeam = objTeamRepository.GetTeamByGroupId(Guid.Parse(groupid));
         List <Domain.Myfashion.Domain.TeamMemberProfile> lstTeamMemberProfile = objTeamMemberProfileRepository.GetTeamMemberProfileByTeamIdAndProfileType(objTeam.Id, "linkedin");
         foreach (var item in lstTeamMemberProfile)
         {
             try
             {
                 if (_objLinkedInAccountRepository.checkLinkedinUserExists(item.ProfileId, Guid.Parse(userid)))
                 {
                     lstLinkedInAccount.Add(objlinkedinaccrepo.getUserInformation(Guid.Parse(userid), item.ProfileId));
                 }
                 else
                 {
                     lstLinkedInAccount.Add(objlinkedinaccrepo.getUserInformation(item.ProfileId));
                 }
             }
             catch (Exception)
             {
             }
         }
         return(new JavaScriptSerializer().Serialize(lstLinkedInAccount));
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.StackTrace);
         return("Something Went Wrong");
     }
 }
Ejemplo n.º 5
0
        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.Myfashion.Domain.TeamMemberProfile objTeamMemberProfile = new Domain.Myfashion.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.Myfashion.Domain.TeamMemberProfile objTeamMemberProfile = new Domain.Myfashion.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);
        }
Ejemplo n.º 6
0
        public string LinkedinProfileDetails(string Userid, string ProfileId)
        {
            Domain.Myfashion.Domain.LinkedInAccount objLinkedinAccount = new Domain.Myfashion.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));
        }
Ejemplo n.º 7
0
        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");
        }
Ejemplo n.º 8
0
 public string GetLinkedinAccountDetailsById(string UserId, string LinkedinId)
 {
     Domain.Myfashion.Domain.LinkedInAccount LinkedAccount = new LinkedInAccount();
     try
     {
         Guid Userid = Guid.Parse(UserId);
         if (objlinkedinaccrepo.checkLinkedinUserExists(LinkedinId, Userid))
         {
             LinkedAccount = objlinkedinaccrepo.getUserInformation(Userid, LinkedinId);
         }
         else
         {
             LinkedAccount = objlinkedinaccrepo.getUserInformation(LinkedinId);
         }
         return(new JavaScriptSerializer().Serialize(LinkedAccount));
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.StackTrace);
         return(new JavaScriptSerializer().Serialize("Please Try Again"));
     }
 }
Ejemplo n.º 9
0
        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();

            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);
            }

            //string res = sociostream.SetStatusUpdate(Linkedin_oauth, message);
            return(ret);
        }
 public string LinkedinProfileDetails(string Userid, string ProfileId)
 {
     Domain.Myfashion.Domain.LinkedInAccount objLinkedinAccount = new Domain.Myfashion.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 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.Myfashion.Domain.TeamMemberProfile objTeamMemberProfile = new Domain.Myfashion.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.Myfashion.Domain.TeamMemberProfile objTeamMemberProfile = new Domain.Myfashion.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.Myfashion.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 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 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();

             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);
             }

             //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.Myfashion.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["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.LinkedInUser l = new GlobusLinkedinLib.App.Core.LinkedInUser();
     List<Domain.Myfashion.Domain.LinkedInUser.User_Updates> lst = l.GetUserUpdate(oauthlin, linkacc.LinkedinUserId, 10);
     return new JavaScriptSerializer().Serialize(lst);
    
 }
Ejemplo n.º 19
0
        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.Myfashion.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);
        }
Ejemplo n.º 20
0
        public string AddLinkedinAccount(string oauth_token, string oauth_verifier, string reuqestTokenSecret, string consumerKey, string consumerSecret, string UserId, string GroupId)
        {
            try
            {
                logger.Error("AddLinkedinAccount()");

                System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls;

                string                      ret            = string.Empty;
                LinkedInProfile             objProfile     = new LinkedInProfile();
                LinkedInProfile.UserProfile objUserProfile = new LinkedInProfile.UserProfile();
                objSocialProfile = new Domain.Myfashion.Domain.SocialProfile();
                oAuthLinkedIn _oauth = new oAuthLinkedIn();
                objLinkedInAccount = new LinkedInAccount();
                #region Get linkedin Profile data from Api
                try
                {
                    _oauth.ConsumerKey = consumerKey;
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                    logger.Error(ex.Message);
                }
                try
                {
                    _oauth.ConsumerSecret = consumerSecret;
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                    logger.Error(ex.Message);
                }
                try
                {
                    _oauth.Token = oauth_token;
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                    logger.Error(ex.Message);
                }
                try
                {
                    _oauth.TokenSecret = reuqestTokenSecret;
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                    logger.Error(ex.Message);
                }
                try
                {
                    _oauth.Verifier = oauth_verifier;
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                    logger.Error(ex.Message);
                }
                try
                {
                    _oauth.AccessTokenGet(oauth_token);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                    logger.Error(ex.Message);
                }
                try
                {
                    objUserProfile = objProfile.GetUserProfile(_oauth);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                    logger.Error(ex.Message);
                }
                #endregion
                dynamic data = objUserProfile;
                try
                {
                    #region LinkedInAccount
                    objLinkedInAccount.UserId         = Guid.Parse(UserId);
                    objLinkedInAccount.LinkedinUserId = data.id.ToString();
                    try
                    {
                        objLinkedInAccount.EmailId = data.email.ToString();
                    }
                    catch (Exception ex)
                    {
                        logger.Error(ex.StackTrace);
                    }
                    objLinkedInAccount.LinkedinUserName = data.first_name.ToString() + data.last_name.ToString();
                    objLinkedInAccount.OAuthToken       = _oauth.Token;
                    objLinkedInAccount.OAuthSecret      = _oauth.TokenSecret;
                    objLinkedInAccount.OAuthVerifier    = _oauth.Verifier;
                    try
                    {
                        objLinkedInAccount.ProfileImageUrl = data.picture_url.ToString();
                    }
                    catch (Exception ex)
                    {
                        logger.Error(ex.StackTrace);
                    }
                    try
                    {
                        objLinkedInAccount.ProfileUrl = data.profile_url.ToString();
                    }
                    catch (Exception ex)
                    {
                        logger.Error(ex.StackTrace);
                    }
                    #endregion
                    #region SocialProfiles
                    try
                    {
                        objLinkedInAccount.Connections = data.connections;
                        objLinkedInAccount.IsActive    = true;
                        objSocialProfile.UserId        = Guid.Parse(UserId);
                        objSocialProfile.ProfileType   = "linkedin";
                        objSocialProfile.ProfileId     = data.id.ToString();
                        objSocialProfile.ProfileStatus = 1;
                        objSocialProfile.ProfileDate   = DateTime.Now;
                        objSocialProfile.Id            = Guid.NewGuid();
                    }
                    catch (Exception ex)
                    {
                        logger.Error(ex.Message);
                    }
                    #endregion SocialProfiles
                    #region Add TeamMemberProfile
                    try
                    {
                        Domain.Myfashion.Domain.Team objTeam = objTeamRepository.GetTeamByGroupId(Guid.Parse(GroupId));
                        objTeamMemberProfile                  = new Domain.Myfashion.Domain.TeamMemberProfile();
                        objTeamMemberProfile.Id               = Guid.NewGuid();
                        objTeamMemberProfile.TeamId           = objTeam.Id;
                        objTeamMemberProfile.Status           = 1;
                        objTeamMemberProfile.ProfileType      = "linkedin";
                        objTeamMemberProfile.StatusUpdateDate = DateTime.Now;
                        objTeamMemberProfile.ProfileId        = objLinkedInAccount.LinkedinUserId;
                        objTeamMemberProfile.ProfileName      = objLinkedInAccount.LinkedinUserName;
                        objTeamMemberProfile.ProfilePicUrl    = objLinkedInAccount.ProfileImageUrl;
                    }
                    catch (Exception ex)
                    {
                        logger.Error(ex.Message);
                    }
                    #endregion
                }
                catch (Exception ex)
                {
                    logger.Error(ex.StackTrace);
                }
                try
                {
                    if (!objLinkedInAccountRepository.checkLinkedinUserExists(objLinkedInAccount.LinkedinUserId, Guid.Parse(UserId)))
                    {
                        objLinkedInAccountRepository.addLinkedinUser(objLinkedInAccount);
                        ret = "LinkedIn Account Added Successfully";
                    }
                    else
                    {
                        ret = "LinkedIn Account Already Exist";
                    }
                    if (!objSocialProfilesRepository.checkUserProfileExist(objSocialProfile))
                    {
                        objSocialProfilesRepository.addNewProfileForUser(objSocialProfile);
                    }
                    if (!objTeamMemberProfileRepository.checkTeamMemberProfile(objTeamMemberProfile.TeamId, objLinkedInAccount.LinkedinUserId))
                    {
                        objTeamMemberProfileRepository.addNewTeamMember(objTeamMemberProfile);
                    }

                    #region Add LinkedIn Feeds
                    LinkedInNetwork objln = new LinkedInNetwork();
                    List <LinkedInNetwork.Network_Updates> userUPdate = objln.GetNetworkUpdates(_oauth, 20);
                    foreach (var item in userUPdate)
                    {
                        try
                        {
                            objLinkedInFeed            = new Domain.Myfashion.Domain.LinkedInFeed();
                            objLinkedInFeed.Feeds      = item.Message;
                            objLinkedInFeed.FromId     = item.PersonId;
                            objLinkedInFeed.FromName   = item.PersonFirstName + " " + item.PersonLastName;
                            objLinkedInFeed.FeedsDate  = Convert.ToDateTime(item.DateTime);
                            objLinkedInFeed.EntryDate  = DateTime.Now;
                            objLinkedInFeed.ProfileId  = objLinkedInAccount.LinkedinUserId;
                            objLinkedInFeed.Type       = item.UpdateType;
                            objLinkedInFeed.UserId     = Guid.Parse(UserId);
                            objLinkedInFeed.FromPicUrl = item.PictureUrl;
                            objLinkedInFeed.ImageUrl   = item.ImageUrl;
                            objLinkedInFeed.FromUrl    = item.url;
                        }
                        catch (Exception ex)
                        {
                            logger.Error(ex.StackTrace);
                        }
                        if (!objLinkedInFeedRepository.checkLinkedInFeedExists(objLinkedInFeed.FeedId, Guid.Parse(UserId)))
                        {
                            objLinkedInFeedRepository.addLinkedInFeed(objLinkedInFeed);
                        }
                    }
                    #endregion


                    #region Add LinkedIn UserUpdates
                    GlobusLinkedinLib.App.Core.LinkedInUser l = new GlobusLinkedinLib.App.Core.LinkedInUser();
                    List <Domain.Myfashion.Domain.LinkedIn_Update_Messages> lst_Messages = l.GetUserUpdateNew(_oauth, objLinkedInAccount.LinkedinUserId, 10);
                    foreach (var item_Messages in lst_Messages)
                    {
                        try
                        {
                            objLinkedInMessage                 = new Domain.Myfashion.Domain.LinkedInMessage();
                            objLinkedInMessage.Id              = Guid.NewGuid();
                            objLinkedInMessage.Message         = item_Messages.Message;
                            objLinkedInMessage.ProfileId       = item_Messages.ProfileId;
                            objLinkedInMessage.ProfileName     = item_Messages.ProfileName;
                            objLinkedInMessage.CreatedDate     = Convert.ToDateTime(item_Messages.CreatedDate);
                            objLinkedInMessage.EntryDate       = DateTime.Now;
                            objLinkedInMessage.Type            = item_Messages.Type;
                            objLinkedInMessage.UserId          = Guid.Parse(UserId);
                            objLinkedInMessage.ImageUrl        = item_Messages.ImageUrl;
                            objLinkedInMessage.FeedId          = item_Messages.FeedId;
                            objLinkedInMessage.ProfileUrl      = item_Messages.ProfileUrl;
                            objLinkedInMessage.Comments        = item_Messages.Comments;
                            objLinkedInMessage.Likes           = item_Messages.Likes;
                            objLinkedInMessage.ProfileImageUrl = item_Messages.ProfileImageUrl;
                        }
                        catch (Exception ex)
                        {
                            logger.Error(ex.StackTrace);
                        }
                        if (!objLinkedInMessageRepository.checkLinkedInMessageExists(objLinkedInAccount.LinkedinUserId, objLinkedInMessage.FeedId, Guid.Parse(UserId)))
                        {
                            objLinkedInMessageRepository.addLinkedInMessage(objLinkedInMessage);
                        }
                    }
                    #endregion
                }
                catch (Exception ex)
                {
                    logger.Error(ex.StackTrace);
                }
                return("");
            }
            catch (Exception ex)
            {
                logger.Error(ex.StackTrace);
                return("");
            }
        }
Ejemplo n.º 21
0
        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);
        }