Ejemplo n.º 1
0
        string GetProfileImage(string ProfileId, string ProfileType)
        {
            Domain.Socioboard.Domain.User objuser = (Domain.Socioboard.Domain.User)Session["User"];
            string profileImg  = "/Themes/@path/Contents/img/anonymousUser.jpg";
            string profileName = "";

            if (ProfileType.Equals("facebook"))
            {
                Socioboard.Api.FacebookAccount.FacebookAccount ApiobjFacebookAccount = new Socioboard.Api.FacebookAccount.FacebookAccount();
                FacebookAccount objFacebookAccount = (FacebookAccount)(new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize(ApiobjFacebookAccount.getFacebookAccountDetailsById(objuser.Id.ToString(), ProfileId), typeof(FacebookAccount)));
                profileName = objFacebookAccount.FbUserName;
                profileImg  = "http://graph.facebook.com/" + objFacebookAccount.FbUserId + "/picture?type=small";
            }
            else if (ProfileType.Equals("twitter"))
            {
                Socioboard.Api.TwitterAccount.TwitterAccount ApiobjTwitterAccount = new Socioboard.Api.TwitterAccount.TwitterAccount();
                TwitterAccount objTwitterAccount = (TwitterAccount)(new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize(ApiobjTwitterAccount.GetTwitterAccountDetailsById(objuser.Id.ToString(), ProfileId), typeof(TwitterAccount)));
                profileName = objTwitterAccount.TwitterScreenName;
                profileImg  = objTwitterAccount.ProfileImageUrl;
            }
            else if (ProfileType.Equals("linkedin"))
            {
                Socioboard.Api.LinkedinAccount.LinkedinAccount ApiobjLinkedinAccount = new Socioboard.Api.LinkedinAccount.LinkedinAccount();
                LinkedInAccount objLinkedInAccount = (LinkedInAccount)(new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize(ApiobjLinkedinAccount.GetLinkedinAccountDetailsById(objuser.Id.ToString(), ProfileId), typeof(LinkedInAccount)));
                profileName = objLinkedInAccount.LinkedinUserName;
                profileImg  = objLinkedInAccount.ProfileImageUrl;
            }
            else if (ProfileType.Equals("tumblr"))
            {
                Socioboard.Api.TumblrAccount.TumblrAccount ApiobjTumblrAccount = new Socioboard.Api.TumblrAccount.TumblrAccount();
                TumblrAccount objTumblrAccount = (TumblrAccount)(new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize(ApiobjTumblrAccount.GetTumblrAccountDetailsById(objuser.Id.ToString(), ProfileId), typeof(TumblrAccount)));
                profileName = objTumblrAccount.tblrUserName;
                profileImg  = "http://api.tumblr.com/v2/blog/" + objTumblrAccount.tblrUserName + ".tumblr.com/avatar";
            }
            return(profileImg + "," + profileName);
        }
 string GetProfileImage(string ProfileId, string ProfileType) 
 {
     Domain.Socioboard.Domain.User objuser = (Domain.Socioboard.Domain.User)Session["User"];
     string profileImg = "/Themes/@path/Contents/img/anonymousUser.jpg";
     string profileName = "";
     if (ProfileType.Equals("facebook")) 
     {
         Socioboard.Api.FacebookAccount.FacebookAccount ApiobjFacebookAccount = new Socioboard.Api.FacebookAccount.FacebookAccount();
         FacebookAccount objFacebookAccount = (FacebookAccount)(new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize(ApiobjFacebookAccount.getFacebookAccountDetailsById(objuser.Id.ToString(), ProfileId), typeof(FacebookAccount)));
         profileName = objFacebookAccount.FbUserName;
         profileImg = "http://graph.facebook.com/" + objFacebookAccount.FbUserId + "/picture?type=small";
        
     }
     else if (ProfileType.Equals("twitter"))
     {
         Socioboard.Api.TwitterAccount.TwitterAccount ApiobjTwitterAccount = new Socioboard.Api.TwitterAccount.TwitterAccount();
         TwitterAccount objTwitterAccount = (TwitterAccount)(new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize(ApiobjTwitterAccount.GetTwitterAccountDetailsById(objuser.Id.ToString(), ProfileId), typeof(TwitterAccount)));
         profileName = objTwitterAccount.TwitterScreenName;
         profileImg = objTwitterAccount.ProfileImageUrl;
     }
     else if (ProfileType.Equals("linkedin"))
     {
         Socioboard.Api.LinkedinAccount.LinkedinAccount ApiobjLinkedinAccount = new Socioboard.Api.LinkedinAccount.LinkedinAccount();
         LinkedInAccount objLinkedInAccount = (LinkedInAccount)(new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize(ApiobjLinkedinAccount.GetLinkedinAccountDetailsById(objuser.Id.ToString(), ProfileId), typeof(LinkedInAccount)));
         profileName = objLinkedInAccount.LinkedinUserName;
         profileImg = objLinkedInAccount.ProfileImageUrl;
        
     }
     else if (ProfileType.Equals("tumblr"))
     {
         Socioboard.Api.TumblrAccount.TumblrAccount ApiobjTumblrAccount = new Socioboard.Api.TumblrAccount.TumblrAccount();
         TumblrAccount objTumblrAccount = (TumblrAccount)(new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize(ApiobjTumblrAccount.GetTumblrAccountDetailsById(objuser.Id.ToString(), ProfileId), typeof(TumblrAccount)));
         profileName = objTumblrAccount.tblrUserName;
         profileImg = "http://api.tumblr.com/v2/blog/" + objTumblrAccount.tblrUserName + ".tumblr.com/avatar";
     }
     return profileImg+","+profileName;
 }