/// <updateGooglePlusUser>
 /// Update google pluse user account details.
 /// </summary>
 /// <param name="gpaccount">Set Values in a GooglePlusAccount Class Property and Pass the same Object of GooglePlusAccount Class.(Domain.GooglePlusAccount)</param>
 public void updateGooglePlusUser(GooglePlusAccount gpaccount)
 {
     //Creates a database connection and opens up a session
     using (NHibernate.ISession session = SessionFactory.GetNewSession())
     {
         //After Session creation, start Transaction.
         using (NHibernate.ITransaction transaction = session.BeginTransaction())
         {
             try
             {
                 //Proceed action, to update google pluse account details
                 session.CreateQuery("Update GooglePlusAccount set GpUserName =:gpusername,AccessToken =:access,RefreshToken=:refreshtoken,GpProfileImage =:gpprofileimage,RefreshToken=:refreshtoken,EmailId=:emailid where GpUserId = :gpuserid and UserId = :userid")
                 .SetParameter("gpusername", gpaccount.GpUserName)
                 .SetParameter("access", gpaccount.AccessToken)
                 .SetParameter("refreshtoken", gpaccount.RefreshToken)
                 .SetParameter("gpprofileimage", gpaccount.GpProfileImage)
                 .SetParameter("emailid", gpaccount.EmailId)
                 .SetParameter("fbuserid", gpaccount.GpUserId)
                 .SetParameter("userid", gpaccount.UserId)
                 .ExecuteUpdate();
                 transaction.Commit();
             }
             catch (Exception ex)
             {
                 Console.WriteLine(ex.StackTrace);
                 // return 0;
             }
         } //End Transaction
     }     //End Session
 }
        /// <getUserDetails>
        /// Get the details of account by Google plus Id.
        /// </summary>
        /// <param name="GpUserId">Id of goole plus account(String)</param>
        /// <param name="gpaccount">Set Values in a GooglePlusAccount Class Property and Pass the same Object of GooglePlusAccount Class.(Domain.GooglePlusAccount)</param>
        public GooglePlusAccount getUserDetails(string GpUserId)
        {
            //Creates a database connection and opens up a session
            using (NHibernate.ISession session = SessionFactory.GetNewSession())
            {
                //After Session creation, start Transaction.
                using (NHibernate.ITransaction transaction = session.BeginTransaction())
                {
                    try
                    {
                        //Proceed action, to get Account detail by google id.
                        NHibernate.IQuery query = session.CreateQuery("from GooglePlusAccount where GpUserId = :gpuserid");

                        query.SetParameter("gpuserid", GpUserId);
                        List <GooglePlusAccount> lst = new List <GooglePlusAccount>();

                        foreach (GooglePlusAccount item in query.Enumerable())
                        {
                            lst.Add(item);
                            break;
                        }
                        GooglePlusAccount fbacc = lst[0];
                        return(fbacc);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                        return(null);
                    }
                } //End Transaction
            }     //End Session
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    if (Session["AdminProfile"] == null)
                    {
                        Response.Redirect("Default.aspx");
                    }

                    string id     = Request.QueryString["id"].ToString();
                    string type   = Request.QueryString["type"].ToString();
                    string userid = Request.QueryString["userid"].ToString();

                    if (type == "twt")
                    {
                        TwtAcc = objTwtRepo.getUserInformation(Guid.Parse(userid), id);
                        Session["updateData"] = TwtAcc;
                        txtName.Text          = TwtAcc.TwitterScreenName;
                        //ddltatus.SelectedValue = TwtAcc.IsActive.ToString();
                    }
                    if (type == "fb")
                    {
                        FBAcc = objFbRepo.getFacebookAccountDetailsById(id, Guid.Parse(userid));
                        Session["updateData"] = FBAcc;
                        txtName.Text          = FBAcc.FbUserName;
                        // ddltatus.SelectedValue = FBAcc.IsActive.ToString();
                    }
                    if (type == "li")
                    {
                        liAcc = objLiRepo.getLinkedinAccountDetailsById(id);
                        Session["updateData"] = liAcc;
                        txtName.Text          = liAcc.LinkedinUserName;
                        // ddltatus.SelectedValue = liAcc.IsActive.ToString();
                    }
                    if (type == "ins")
                    {
                        InsAcc = objInsRepo.getInstagramAccountDetailsById(id, Guid.Parse(userid));
                        Session["updateData"] = InsAcc;
                        txtName.Text          = InsAcc.InsUserName;
                        //   ddltatus.SelectedValue = InsAcc.IsActive.ToString();
                    }
                    if (type == "gp")
                    {
                        GpAcc = objgpRepo.getGooglePlusAccountDetailsById(id, Guid.Parse(userid));
                        Session["updateData"] = GpAcc;
                        txtName.Text          = GpAcc.GpUserName;
                        //ddltatus.SelectedValue = GpAcc.IsActive.ToString();
                    }
                }
            }
            catch (Exception Err)
            {
                logger.Error(Err.Message);
            }
        }
Exemplo n.º 4
0
        public ActionResult EditProfileDetails(string ProfileId, string UserId, string Network)
        {
            Dictionary <string, object> objProfileToEdit = new Dictionary <string, object>();

            if (Network == "Facebook")
            {
                Api.FacebookAccount.FacebookAccount Apiobjfb = new Api.FacebookAccount.FacebookAccount();
                FacebookAccount objFbAccount = (FacebookAccount)(new JavaScriptSerializer().Deserialize(Apiobjfb.getFacebookAccountDetailsById(UserId, ProfileId), typeof(FacebookAccount)));
                Session["UpdateProfileData"] = objFbAccount;
                objProfileToEdit.Add("Facebook", objFbAccount);
            }
            if (Network == "Twitter")
            {
                Api.TwitterAccount.TwitterAccount Apiobjtwt = new Api.TwitterAccount.TwitterAccount();
                TwitterAccount objtwtAccount = (TwitterAccount)(new JavaScriptSerializer().Deserialize(Apiobjtwt.GetTwitterAccountDetailsById(UserId, ProfileId), typeof(TwitterAccount)));
                Session["UpdateProfileData"] = objtwtAccount;
                objProfileToEdit.Add("Twitter", objtwtAccount);
            }
            if (Network == "Linkedin")
            {
                Api.LinkedinAccount.LinkedinAccount Apiobjlin = new Api.LinkedinAccount.LinkedinAccount();
                LinkedInAccount objLinAccount = (LinkedInAccount)(new JavaScriptSerializer().Deserialize(Apiobjlin.GetLinkedinAccountDetailsById(UserId, ProfileId), typeof(LinkedInAccount)));
                Session["UpdateProfileData"] = objLinAccount;
                objProfileToEdit.Add("Linkedin", objLinAccount);
            }
            if (Network == "Instagram")
            {
                Api.InstagramAccount.InstagramAccount ApiobjIns = new Api.InstagramAccount.InstagramAccount();
                InstagramAccount objInsAccount = (InstagramAccount)(new JavaScriptSerializer().Deserialize(ApiobjIns.UserInformation(UserId, ProfileId), typeof(InstagramAccount)));
                Session["UpdateProfileData"] = objInsAccount;
                objProfileToEdit.Add("Instagram", objInsAccount);
            }
            if (Network == "Tumblr")
            {
                Api.TumblrAccount.TumblrAccount Apiobjtmb = new Api.TumblrAccount.TumblrAccount();
                TumblrAccount objTmbAccount = (TumblrAccount)(new JavaScriptSerializer().Deserialize(Apiobjtmb.GetTumblrAccountDetailsById(UserId, ProfileId), typeof(TumblrAccount)));
                Session["UpdateProfileData"] = objTmbAccount;
                objProfileToEdit.Add("Tumblr", objTmbAccount);
            }
            if (Network == "Youtube")
            {
                Api.YoutubeAccount.YoutubeAccount ApiobjYoutb = new Api.YoutubeAccount.YoutubeAccount();
                YoutubeAccount objYouTbAccount = (YoutubeAccount)(new JavaScriptSerializer().Deserialize(ApiobjYoutb.GetYoutubeAccountDetailsById(UserId, ProfileId), typeof(YoutubeAccount)));
                Session["UpdateProfileData"] = objYouTbAccount;
                objProfileToEdit.Add("Youtube", objYouTbAccount);
            }
            if (Network == "GooglePlus")
            {
                Api.GooglePlusAccount.GooglePlusAccount Apiobjgplus = new Api.GooglePlusAccount.GooglePlusAccount();
                GooglePlusAccount objGPAccount = (GooglePlusAccount)(new JavaScriptSerializer().Deserialize(Apiobjgplus.GetGooglePlusAccountDetailsById(UserId, ProfileId), typeof(GooglePlusAccount)));
                Session["UpdateProfileData"] = objGPAccount;
                objProfileToEdit.Add("GooglePlus", objGPAccount);
            }

            return(View(objProfileToEdit));
        }
 /// <addGooglePlusUser>
 /// Add google account of user
 /// </summary>
 /// <param name="gpaccount">Set Values in a GooglePlusAccount Class Property and Pass the same Object of GooglePlusAccount Class.(Domain.GooglePlusAccount)</param>
 public void addGooglePlusUser(GooglePlusAccount gpaccount)
 {
     //Creates a database connection and opens up a session
     using (NHibernate.ISession session = SessionFactory.GetNewSession())
     {
         //After Session creation, start Transaction.
         using (NHibernate.ITransaction transaction = session.BeginTransaction())
         {
             //Proceed action to Save new data .
             session.Save(gpaccount);
             transaction.Commit();
         } //End Transaction
     }     //End Session
 }
Exemplo n.º 6
0
 public string UserInformation(string UserId, string GooglePlusId)
 {
     try
     {
         Guid Userid = Guid.Parse(UserId);
         GooglePlusAccountRepository linkedinaccrepo = new GooglePlusAccountRepository();
         GooglePlusAccount           LinkedAccount   = linkedinaccrepo.getGooglePlusAccountDetailsById(GooglePlusId, Userid);
         return(new JavaScriptSerializer().Serialize(LinkedAccount));
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.StackTrace);
         return(new JavaScriptSerializer().Serialize("Please Try Again"));
     }
 }
Exemplo n.º 7
0
        public void GetUerProfile(GooglePlusAccount objgpAcc, string acces_token, string refresh_token, Guid UserId)
        {
            PeopleController            obj       = new PeopleController();
            oAuthToken                  objtoken  = new oAuthToken();
            GooglePlusAccountRepository objgpRepo = new GooglePlusAccountRepository();

            SocialProfilesRepository socioprofilerepo = new SocialProfilesRepository();
            SocialProfile            socioprofile     = new SocialProfile();

            socioprofile.Id          = Guid.NewGuid();
            socioprofile.ProfileDate = DateTime.Now;
            socioprofile.ProfileId   = objgpAcc.GpUserId;
            socioprofile.ProfileType = "googleplus";
            socioprofile.UserId      = UserId;


            JArray objPeopleList = obj.GetPeopleList(objgpAcc.GpUserId, acces_token, "visible");

            objgpAcc.PeopleCount = objPeopleList.Count();


            if (!objgpRepo.checkGooglePlusUserExists(objgpAcc.GpUserId, UserId))
            {
                objgpRepo.addGooglePlusUser(objgpAcc);
                if (!socioprofilerepo.checkUserProfileExist(socioprofile))
                {
                    socioprofilerepo.addNewProfileForUser(socioprofile);
                }
                else
                {
                    socioprofilerepo.updateSocialProfile(socioprofile);
                }
            }
            else
            {
                objgpRepo.updateGooglePlusUser(objgpAcc);
                if (!socioprofilerepo.checkUserProfileExist(socioprofile))
                {
                    socioprofilerepo.addNewProfileForUser(socioprofile);
                }
                else
                {
                    socioprofilerepo.updateSocialProfile(socioprofile);
                }
            }
            GetUserActivities(objgpAcc.GpUserId, acces_token, UserId);
        }
 /// <getGooglePlusAccountDetailsById>
 /// Get the details of Google account By Id.
 /// </summary>
 /// <param name="gpuserid">Google Plus user id(string).</param>
 /// <param name="userId">User id(Guid)</param>
 /// <returns>Return the object of group where we get all values from object.(Domain.GooglePlusAccount)</returns>
 public GooglePlusAccount getGooglePlusAccountDetailsById(string gpuserid, Guid userId)
 {
     //Creates a database connection and opens up a session
     using (NHibernate.ISession session = SessionFactory.GetNewSession())
     {
         //After Session creation, start Transaction.
         using (NHibernate.ITransaction transaction = session.BeginTransaction())
         {
             //Proceed action, to get Details of account by user id and Google plus id.
             NHibernate.IQuery query = session.CreateQuery("from GooglePlusAccount where GpUserId = :gpuserid and UserId=:userId");
             query.SetParameter("gpuserid", gpuserid);
             query.SetParameter("userId", userId);
             ArrayList alstFBAccounts = new ArrayList();
             foreach (var item in query.Enumerable())
             {
                 alstFBAccounts.Add(item);
             }
             GooglePlusAccount result = (GooglePlusAccount)query.UniqueResult();
             return(result);
         } //End Transaction
     }     //End Session
 }
Exemplo n.º 9
0
 public string ProfilesConnected(string UserId)
 {
     try
     {
         Guid userid = Guid.Parse(UserId);
         SocialProfilesRepository socialRepo      = new SocialProfilesRepository();
         List <SocialProfile>     lstsocioprofile = socialRepo.getAllSocialProfilesOfUser(userid);
         List <profileConnected>  lstProfile      = new List <profileConnected>();
         foreach (SocialProfile sp in lstsocioprofile)
         {
             profileConnected pc = new profileConnected();
             pc.Id            = sp.Id;
             pc.ProfileDate   = sp.ProfileDate;
             pc.ProfileId     = sp.ProfileId;
             pc.ProfileStatus = sp.ProfileStatus;
             pc.ProfileType   = sp.ProfileType;
             pc.UserId        = sp.UserId;
             if (sp.ProfileType == "facebook")
             {
                 try
                 {
                     FacebookAccountRepository objFbAccRepo = new FacebookAccountRepository();
                     FacebookAccount           objFbAcc     = objFbAccRepo.getUserDetails(sp.ProfileId);
                     pc.ProfileName   = objFbAcc.FbUserName;
                     pc.ProfileImgUrl = "http://graph.facebook.com/" + sp.ProfileId + "/picture?type=small";
                 }
                 catch (Exception ex)
                 {
                     Console.WriteLine(ex.StackTrace);
                 }
             }
             else if (sp.ProfileType == "twitter")
             {
                 try
                 {
                     TwitterAccountRepository objTwtAccRepo = new TwitterAccountRepository();
                     TwitterAccount           objTwtAcc     = objTwtAccRepo.getUserInfo(sp.ProfileId);
                     pc.ProfileName   = objTwtAcc.TwitterScreenName;
                     pc.ProfileImgUrl = objTwtAcc.ProfileImageUrl;
                 }
                 catch (Exception ex)
                 {
                     Console.WriteLine(ex.StackTrace);
                 }
             }
             else if (sp.ProfileType == "instagram")
             {
                 try
                 {
                     InstagramAccountRepository objInsAccRepo = new InstagramAccountRepository();
                     InstagramAccount           objInsAcc     = objInsAccRepo.getInstagramAccountById(sp.ProfileId);
                     pc.ProfileName   = objInsAcc.InsUserName;
                     pc.ProfileImgUrl = objInsAcc.ProfileUrl;
                 }
                 catch (Exception ex)
                 {
                     Console.WriteLine(ex.StackTrace);
                 }
             }
             else if (sp.ProfileType == "linkedin")
             {
                 try
                 {
                     LinkedInAccountRepository objLiAccRepo = new LinkedInAccountRepository();
                     LinkedInAccount           objLiAcc     = objLiAccRepo.getLinkedinAccountDetailsById(sp.ProfileId);
                     pc.ProfileName   = objLiAcc.LinkedinUserName;
                     pc.ProfileImgUrl = objLiAcc.ProfileImageUrl;
                 }
                 catch (Exception ex)
                 {
                     Console.WriteLine(ex.StackTrace);
                 }
             }
             else if (sp.ProfileType == "googleplus")
             {
                 try
                 {
                     GooglePlusAccountRepository objGpAccRepo = new GooglePlusAccountRepository();
                     GooglePlusAccount           objGpAcc     = objGpAccRepo.getUserDetails(sp.ProfileId);
                     pc.ProfileName   = objGpAcc.GpUserName;
                     pc.ProfileImgUrl = objGpAcc.GpProfileImage;
                 }
                 catch (Exception ex)
                 {
                     Console.WriteLine(ex.StackTrace);
                 }
             }
             lstProfile.Add(pc);
         }
         return(new JavaScriptSerializer().Serialize(lstProfile));
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.StackTrace);
         return(new JavaScriptSerializer().Serialize("Please Try Again"));
     }
 }
Exemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            oAuthToken        objToken    = new oAuthToken();
            GplusHelper       objGpHelper = new GplusHelper();
            UserRepository    objUserRepo = new UserRepository();
            PeopleController  obj         = new PeopleController();
            GooglePlusAccount objgpAcc    = new GooglePlusAccount();
            User user = new User();

            try
            {
                string objRefresh = objToken.GetRefreshToken(Request.QueryString["code"]);
                if (!objRefresh.StartsWith("["))
                {
                    objRefresh = "[" + objRefresh + "]";
                }
                JArray objArray = JArray.Parse(objRefresh);
                if (Session["login"] != null)
                {
                    if (Session["login"].ToString() == "googleplus")
                    {
                        user               = new User();
                        user.CreateDate    = DateTime.Now;
                        user.ExpiryDate    = DateTime.Now.AddMonths(1);
                        user.Id            = Guid.NewGuid();
                        user.PaymentStatus = "unpaid";
                    }
                }
                else
                {
                    /*User class in SocioBoard.Domain to check authenticated user*/
                    user = (User)Session["LoggedUser"];
                }
                foreach (var item in objArray)
                {
                    try
                    {
                        JArray objEmail   = objToken.GetUserInfo("me", item["access_token"].ToString());
                        JArray objProfile = obj.GetPeopleProfile("me", item["access_token"].ToString());
                        // user = (User)HttpContext.Current.Session["LoggedUser"];
                        foreach (var itemEmail in objEmail)
                        {
                            objgpAcc.EmailId = itemEmail["email"].ToString();
                        }
                        foreach (var itemProfile in objProfile)
                        {
                            objgpAcc.GpUserId       = itemProfile["id"].ToString();
                            objgpAcc.AccessToken    = item["access_token"].ToString();
                            objgpAcc.EntryDate      = DateTime.Now;
                            objgpAcc.GpProfileImage = itemProfile["image"]["url"].ToString();
                            objgpAcc.GpUserName     = itemProfile["displayName"].ToString();
                            objgpAcc.Id             = Guid.NewGuid();
                            objgpAcc.IsActive       = 1;
                            objgpAcc.RefreshToken   = item["refresh_token"].ToString();
                            objgpAcc.UserId         = user.Id;
                        }

                        if (Session["login"] != null)
                        {
                            if (string.IsNullOrEmpty(user.Password))
                            {
                                if (Session["login"].ToString() == "googleplus")
                                {
                                    if (objUserRepo.IsUserExist(objgpAcc.EmailId))//user.EmailId
                                    {
                                        // user = null;
                                        user = objUserRepo.getUserInfoByEmail(objgpAcc.EmailId);//user.EmailId
                                        if (!string.IsNullOrEmpty(user.Password))
                                        {
                                            //Session["LoggedUser"] = user;
                                            //Response.Redirect("Home.aspx");

                                            if (user.UserStatus == 1)
                                            {
                                                Session["LoggedUser"] = user;
                                                Response.Redirect("Home.aspx");
                                            }
                                            else
                                            {
                                                //check user is block or not
                                                Session["fblogout"] = "NOTACTIVATED";

                                                Response.Redirect("Default.aspx");
                                            }
                                        }
                                    }
                                    else
                                    {
                                        user.EmailId    = objgpAcc.EmailId;
                                        user.UserName   = objgpAcc.GpUserName;
                                        user.ProfileUrl = objgpAcc.GpProfileImage;
                                        user.UserStatus = 1;
                                        user.CreateDate = DateTime.Now;
                                        user.ExpiryDate = DateTime.Now.AddDays(30);
                                        UserRepository.Add(user);
                                    }
                                    Session["LoggedUser"] = user;
                                    objgpAcc.UserId       = user.Id;
                                }
                            }
                        }
                        objGpHelper.GetUerProfile(objgpAcc, item["access_token"].ToString(), item["refresh_token"].ToString(), user.Id);



                        if (Session["login"] != null)
                        {
                            if (string.IsNullOrEmpty(user.Password))
                            {
                                if (Session["login"].ToString() == "googleplus")
                                {
                                    // Response.Redirect("Pricing.aspx");
                                    Response.Redirect("NetworkLogin.aspx?type=Free");
                                }
                            }
                            else
                            {
                                Response.Redirect("Home.aspx");
                            }
                        }
                        else
                        {
                            Response.Redirect("Home.aspx");
                        }
                    }
                    catch (Exception ex)
                    {
                        logger.Error(ex.StackTrace);
                        Console.WriteLine(ex.StackTrace);
                    }
                }
            }
            catch (Exception Err)
            {
                Console.Write(Err.Message.ToString());
                logger.Error(Err.StackTrace);
            }
        }
Exemplo n.º 11
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                bool   status = false;
                string type   = Request.QueryString["type"].ToString();
                if (Session["updateData"] != null)
                {
                    if (type == "twt")
                    {
                        TwitterAccount twtAcc = (TwitterAccount)Session["updateData"];
                        //if (ddltatus.SelectedValue == "1")

                        status = true;
                        twtAcc.TwitterScreenName = txtName.Text;
                        twtAcc.IsActive          = status;
                        objTwtRepo.updateTwitterUser(twtAcc);
                    }
                    if (type == "fb")
                    {
                        FacebookAccount fbAcc = (FacebookAccount)Session["updateData"];
                        // if (ddltatus.SelectedValue == "1")
                        FBAcc.FbUserName = txtName.Text;
                        status           = true;
                        fbAcc.IsActive   = 1;
                        objFbRepo.updateFacebookUser(fbAcc);
                    }
                    if (type == "ins")
                    {
                        InstagramAccount insAcc = (InstagramAccount)Session["updateData"];
                        //if (ddltatus.SelectedValue == "1")
                        InsAcc.InsUserName = txtName.Text;
                        status             = true;
                        insAcc.IsActive    = status;
                        objInsRepo.updateInstagramUser(insAcc);
                    }
                    if (type == "li")
                    {
                        LinkedInAccount liAcc = (LinkedInAccount)Session["updateData"];
                        // if (ddltatus.SelectedValue == "1")
                        liAcc.LinkedinUserName = txtName.Text;
                        status         = true;
                        liAcc.IsActive = status;
                        objLiRepo.updateLinkedinUser(liAcc);
                    }
                    if (type == "gp")
                    {
                        GooglePlusAccount gpAcc = (GooglePlusAccount)Session["updateData"];
                        //  gpAcc.IsActive = int.Parse(ddltatus.SelectedValue);
                        GpAcc.GpUserName = txtName.Text;
                        gpAcc.IsActive   = 1;
                        objgpRepo.updateGooglePlusUser(gpAcc);
                    }
                }
            }
            catch (Exception Err)
            {
                logger.Error(Err.Message);
                Response.Write(Err.StackTrace);
            }
        }
Exemplo n.º 12
0
        private static async Task <ISocialSiteAccount> GetSocialAccountFromGroupProfile(Guid objUserid, Domain.Socioboard.Domain.GroupProfile objGroupProfile)
        {
            ISocialSiteAccount objSocialSiteAccount = null;
            string             accesstoken          = string.Empty;

            try {
                accesstoken = System.Web.HttpContext.Current.Session["access_token"].ToString();
            }
            catch { }

            if (objGroupProfile.ProfileType == "facebook" || objGroupProfile.ProfileType == "facebook_page")
            {
                //using (Api.FacebookAccount.FacebookAccount ApiobjFacebookAccount = new Api.FacebookAccount.FacebookAccount())
                //{
                //    ApiobjFacebookAccount.Timeout = 300000;
                //    objSocialSiteAccount = (FacebookAccount)(new JavaScriptSerializer().Deserialize(ApiobjFacebookAccount.getFacebookAccountDetailsById(objUserid.ToString(), objGroupProfile.ProfileId.ToString()), typeof(FacebookAccount)));
                //}
                FacebookAccount     fbaccount  = new FacebookAccount();
                HttpResponseMessage fbresponse = await WebApiReq.GetReq("api/ApiFacebookAccount/GetFacebookAcoount?ProfileId=" + objGroupProfile.ProfileId, "Bearer", accesstoken);

                if (fbresponse.IsSuccessStatusCode)
                {
                    fbaccount = await fbresponse.Content.ReadAsAsync <Domain.Socioboard.Domain.FacebookAccount>();

                    objSocialSiteAccount = fbaccount;
                }
            }
            else if (objGroupProfile.ProfileType == "twitter")
            {
                //using (Api.TwitterAccount.TwitterAccount ApiobjTwitterAccount = new Api.TwitterAccount.TwitterAccount())
                //{

                //    ApiobjTwitterAccount.Timeout = 300000;
                //    objSocialSiteAccount = (TwitterAccount)(new JavaScriptSerializer().Deserialize(ApiobjTwitterAccount.GetTwitterAccountDetailsById(objUserid.ToString(), objGroupProfile.ProfileId.ToString()), typeof(TwitterAccount)));

                //}
                TwitterAccount      twitterAcc      = new TwitterAccount();
                HttpResponseMessage twitterresponse = await WebApiReq.GetReq("api/ApiTwitterAccount/GetTwitterAccountDetailsById?ProfileId=" + objGroupProfile.ProfileId, "Bearer", accesstoken);

                if (twitterresponse.IsSuccessStatusCode)
                {
                    twitterAcc = await twitterresponse.Content.ReadAsAsync <Domain.Socioboard.Domain.TwitterAccount>();

                    objSocialSiteAccount = twitterAcc;
                }
            }
            else if (objGroupProfile.ProfileType == "linkedin")
            {
                //using (Api.LinkedinAccount.LinkedinAccount ApiobjLinkedinAccount = new Api.LinkedinAccount.LinkedinAccount())
                //{

                //    ApiobjLinkedinAccount.Timeout = 300000;
                //    objSocialSiteAccount = (LinkedInAccount)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinAccount.GetLinkedinAccountDetailsById(objUserid.ToString(), objGroupProfile.ProfileId.ToString()), typeof(LinkedInAccount)));

                //}
                LinkedInAccount     LinkedinAcc      = new LinkedInAccount();
                HttpResponseMessage Linkedinresponse = await WebApiReq.GetReq("api/ApiLinkedinAccount/GetLinkedinAccountDetailsById?ProfileId=" + objGroupProfile.ProfileId, "Bearer", accesstoken);

                if (Linkedinresponse.IsSuccessStatusCode)
                {
                    LinkedinAcc = await Linkedinresponse.Content.ReadAsAsync <Domain.Socioboard.Domain.LinkedInAccount>();

                    objSocialSiteAccount = LinkedinAcc;
                }
            }
            else if (objGroupProfile.ProfileType == "instagram")
            {
                //using (Api.InstagramAccount.InstagramAccount ApiobjInstagramAccount = new Api.InstagramAccount.InstagramAccount())
                //{
                //    objSocialSiteAccount = (InstagramAccount)(new JavaScriptSerializer().Deserialize(ApiobjInstagramAccount.UserInformation(objUserid.ToString(), objGroupProfile.ProfileId.ToString()), typeof(InstagramAccount)));

                //}
                InstagramAccount    instAcc  = new InstagramAccount();
                HttpResponseMessage response = await WebApiReq.GetReq("api/ApiInstagramAccount/GetInstagramAccount?ProfileId=" + objGroupProfile.ProfileId, "Bearer", accesstoken);

                if (response.IsSuccessStatusCode)
                {
                    instAcc = await response.Content.ReadAsAsync <Domain.Socioboard.Domain.InstagramAccount>();

                    objSocialSiteAccount = instAcc;
                }
            }
            else if (objGroupProfile.ProfileType == "youtube")
            {
                //using (Api.YoutubeAccount.YoutubeAccount ApiobjYoutubeAccount = new Api.YoutubeAccount.YoutubeAccount())
                //{

                //    ApiobjYoutubeAccount.Timeout = 300000;
                //    objSocialSiteAccount = (YoutubeAccount)(new JavaScriptSerializer().Deserialize(ApiobjYoutubeAccount.GetYoutubeAccountDetailsById(objUserid.ToString(), objGroupProfile.ProfileId.ToString()), typeof(YoutubeAccount)));

                //}

                YoutubeAccount      ytAcc    = new YoutubeAccount();
                HttpResponseMessage response = await WebApiReq.GetReq("api/ApiYoutubeAccount/GetYoutubeAccount?ProfileId=" + objGroupProfile.ProfileId, "Bearer", accesstoken);

                if (response.IsSuccessStatusCode)
                {
                    ytAcc = await response.Content.ReadAsAsync <Domain.Socioboard.Domain.YoutubeAccount>();

                    objSocialSiteAccount = ytAcc;
                }
            }
            else if (objGroupProfile.ProfileType == "tumblr")
            {
                //using (Api.TumblrAccount.TumblrAccount ApiobjTumblrAccount = new Api.TumblrAccount.TumblrAccount())
                //{

                //    ApiobjTumblrAccount.Timeout = 300000;
                //    objSocialSiteAccount = (TumblrAccount)(new JavaScriptSerializer().Deserialize(ApiobjTumblrAccount.GetTumblrAccountDetailsById(objUserid.ToString(), objGroupProfile.ProfileId.ToString()), typeof(TumblrAccount)));

                //}
                TumblrAccount       ytAcc    = new TumblrAccount();
                HttpResponseMessage response = await WebApiReq.GetReq("api/ApiTumblrAccount/GetTumblrAccountDetailsById?ProfileId=" + objGroupProfile.ProfileId, "Bearer", accesstoken);

                if (response.IsSuccessStatusCode)
                {
                    ytAcc = await response.Content.ReadAsAsync <Domain.Socioboard.Domain.TumblrAccount>();

                    objSocialSiteAccount = ytAcc;
                }
            }
            else if (objGroupProfile.ProfileType == "linkedincompanypage")
            {
                //using (Api.LinkedinCompanyPage.LinkedinCompanyPage objLinkedinCompanyPage = new Api.LinkedinCompanyPage.LinkedinCompanyPage())
                //{

                //    objLinkedinCompanyPage.Timeout = 300000;
                //    objSocialSiteAccount = (LinkedinCompanyPage)(new JavaScriptSerializer().Deserialize(objLinkedinCompanyPage.GetLinkedinCompanyPageDetailsByUserIdAndPageId(objUserid.ToString(), objGroupProfile.ProfileId.ToString()), typeof(LinkedinCompanyPage)));
                //}

                LinkedinCompanyPage licompanypage = new LinkedinCompanyPage();
                HttpResponseMessage response      = await WebApiReq.GetReq("api/ApiLinkedinCompanyPage/GetLinkedinCompanyPageDetailsByUserIdAndPageId?ProfileId=" + objGroupProfile.ProfileId, "Bearer", accesstoken);

                if (response.IsSuccessStatusCode)
                {
                    licompanypage = await response.Content.ReadAsAsync <Domain.Socioboard.Domain.LinkedinCompanyPage>();

                    objSocialSiteAccount = licompanypage;
                }
            }
            else if (objGroupProfile.ProfileType == "gplus")
            {
                //using (Api.GooglePlusAccount.GooglePlusAccount ApiobjGooglePlusAccount = new Api.GooglePlusAccount.GooglePlusAccount())
                //{

                //    ApiobjGooglePlusAccount.Timeout = 300000;
                //    objSocialSiteAccount = (GooglePlusAccount)(new JavaScriptSerializer().Deserialize(ApiobjGooglePlusAccount.GetGooglePlusAccountDetailsById(objUserid.ToString(), objGroupProfile.ProfileId), typeof(GooglePlusAccount)));

                //}
                GooglePlusAccount   googlePlusAccount = new GooglePlusAccount();
                HttpResponseMessage response          = await WebApiReq.GetReq("api/ApiGooglePlusAccount/GetGooglePlusAccount?ProfileId=" + objGroupProfile.ProfileId, "Bearer", accesstoken);

                if (response.IsSuccessStatusCode)
                {
                    googlePlusAccount = await response.Content.ReadAsAsync <Domain.Socioboard.Domain.GooglePlusAccount>();

                    objSocialSiteAccount = googlePlusAccount;
                }
            }
            else if (objGroupProfile.ProfileType == "googleanalytics")
            {
                //using (Api.GoogleAnalyticsAccount.GoogleAnalyticsAccount ApiobjGoogleAnalyticsAccount = new Api.GoogleAnalyticsAccount.GoogleAnalyticsAccount())
                //{

                //    ApiobjGoogleAnalyticsAccount.Timeout = 300000;
                //    objSocialSiteAccount = (GoogleAnalyticsAccount)(new JavaScriptSerializer().Deserialize(ApiobjGoogleAnalyticsAccount.GetGooglePlusAccountDetailsById(objUserid.ToString(), objGroupProfile.ProfileId), typeof(GoogleAnalyticsAccount)));

                //}
                GoogleAnalyticsAccount googlePlusAccount = new GoogleAnalyticsAccount();
                HttpResponseMessage    response          = await WebApiReq.GetReq("api/ApiGoogleAnalyticsAccount/GetGooglePlusAccountDetailsById?ProfileId=" + objGroupProfile.ProfileId + "&UserId=" + objUserid.ToString(), "Bearer", accesstoken);

                if (response.IsSuccessStatusCode)
                {
                    googlePlusAccount = await response.Content.ReadAsAsync <Domain.Socioboard.Domain.GoogleAnalyticsAccount>();

                    objSocialSiteAccount = googlePlusAccount;
                }
            }


            return(objSocialSiteAccount);
        }