Exemplo n.º 1
0
        public ActionResult getProfileDetails(string ProfileId, string Network)
        {
            Dictionary <string, object> _dicProfileDetails = new Dictionary <string, object>();

            if (Network == "twitter")
            {
                Domain.Socioboard.Domain.User objUser       = (Domain.Socioboard.Domain.User)Session["User"];
                Api.Twitter.Twitter           ApiobjTwitter = new Api.Twitter.Twitter();
                string ProfileDescription = ApiobjTwitter.TwitterProfileDetails(objUser.Id.ToString(), ProfileId);
                // Domain.Socioboard.Helper.TwitterProfileDetails ProfileDetails = (Domain.Socioboard.Helper.TwitterProfileDetails)(new JavaScriptSerializer().Deserialize(ProfileDescription, typeof(Domain.Socioboard.Helper.TwitterProfileDetails)));
                Domain.Socioboard.Domain.TwitterAccount ProfileDetails = (Domain.Socioboard.Domain.TwitterAccount)(new JavaScriptSerializer().Deserialize(ProfileDescription, typeof(Domain.Socioboard.Domain.TwitterAccount)));
                _dicProfileDetails.Add("Twitter", ProfileDetails);
            }
            if (Network == "facebook")
            {
                Domain.Socioboard.Domain.User objUser        = (Domain.Socioboard.Domain.User)Session["User"];
                Api.Facebook.Facebook         ApiobjFacebook = new Api.Facebook.Facebook();
                string ProfileDescription = ApiobjFacebook.FacebookProfileDetails(objUser.Id.ToString(), ProfileId);
                Domain.Socioboard.Domain.FacebookAccount ProfileDetails = (Domain.Socioboard.Domain.FacebookAccount)(new JavaScriptSerializer().Deserialize(ProfileDescription, typeof(Domain.Socioboard.Domain.FacebookAccount)));
                _dicProfileDetails.Add("Facebook", ProfileDetails);
            }
            if (Network == "linkedin")
            {
                Domain.Socioboard.Domain.User objUser        = (Domain.Socioboard.Domain.User)Session["User"];
                Api.Linkedin.Linkedin         ApiobjLinkedin = new Api.Linkedin.Linkedin();
                string ProfileDescription = ApiobjLinkedin.LinkedinProfileDetails(objUser.Id.ToString(), ProfileId);
                Domain.Socioboard.Domain.LinkedInAccount ProfileDetails = (Domain.Socioboard.Domain.LinkedInAccount)(new JavaScriptSerializer().Deserialize(ProfileDescription, typeof(Domain.Socioboard.Domain.LinkedInAccount)));
                _dicProfileDetails.Add("Linkedin", ProfileDetails);
            }

            return(PartialView("_SocialProfileDetail", _dicProfileDetails));
        }
 public IHttpActionResult GetLinkedinAccountDetailsById(string ProfileId)
 {
     Domain.Socioboard.Domain.LinkedInAccount LinkedAccount = new Domain.Socioboard.Domain.LinkedInAccount();
     try
     {
         LinkedAccount = objlinkedinaccrepo.getLinkedinAccountDetailsById(ProfileId);
         return(Ok(LinkedAccount));
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.StackTrace);
         return(BadRequest("Error"));
     }
 }
 public IHttpActionResult GetLinkedinAccountDetailsById(string ProfileId)
 {
     Domain.Socioboard.Domain.LinkedInAccount LinkedAccount = new Domain.Socioboard.Domain.LinkedInAccount();
     try
     {
         LinkedAccount = objlinkedinaccrepo.getLinkedinAccountDetailsById(ProfileId);
         return Ok(LinkedAccount);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.StackTrace);
         return BadRequest("Error");
     }
 }