Beispiel #1
0
        public static List <Domain.Socioboard.Domain.TeamMemberProfile> GetUserTeamMemberProfiles()
        {
            User objUser = (User)System.Web.HttpContext.Current.Session["User"];
            List <Domain.Socioboard.Domain.TeamMemberProfile> lstTeamMemberProfile = new List <Domain.Socioboard.Domain.TeamMemberProfile>();

            Api.Team.Team objApiTeam = new Api.Team.Team();
            string        groupid    = System.Web.HttpContext.Current.Session["group"].ToString();
            JObject       team       = JObject.Parse(objApiTeam.GetTeamByGroupId(System.Web.HttpContext.Current.Session["group"].ToString()));

            Api.TeamMemberProfile.TeamMemberProfile objApiTeamMemberProfile = new Api.TeamMemberProfile.TeamMemberProfile();
            JArray TeamMemberProfiles = JArray.Parse(objApiTeamMemberProfile.GetTeamMemberProfilesByTeamId(Convert.ToString(team["Id"])));

            foreach (var item in TeamMemberProfiles)
            {
                try
                {
                    Domain.Socioboard.Domain.TeamMemberProfile objTeamMemberProfile = GetTeamMemberProfileFromJObject(item);
                    lstTeamMemberProfile.Add(objTeamMemberProfile);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                    //return null;
                }
            }
            return(lstTeamMemberProfile);
        }
        public static Dictionary<Domain.Socioboard.Domain.TeamMemberProfile, object> GetUserProfilesccordingToGroup()
        {
            User objUser = (User)System.Web.HttpContext.Current.Session["User"];
            Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups();
            ApiobjGroups.Timeout = 300000;
            //ApiobjGroups.GetGroupDetailsByGroupId
            Groups objGroups = (Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(System.Web.HttpContext.Current.Session["group"].ToString()), typeof(Groups)));
            Dictionary<Domain.Socioboard.Domain.TeamMemberProfile, object> dict_TeamMember = new Dictionary<Domain.Socioboard.Domain.TeamMemberProfile, object>();
            Api.Team.Team objApiTeam = new Api.Team.Team();
            objApiTeam.Timeout = 300000;
            JObject team = JObject.Parse(objApiTeam.GetTeamByGroupId(System.Web.HttpContext.Current.Session["group"].ToString()));
            Api.TeamMemberProfile.TeamMemberProfile objApiTeamMemberProfile = new Api.TeamMemberProfile.TeamMemberProfile();
            objApiTeamMemberProfile.Timeout = 300000;
            JArray TeamMemberProfiles = JArray.Parse(objApiTeamMemberProfile.GetTeamMemberProfilesByTeamId(Convert.ToString(team["Id"])));
            foreach (var item in TeamMemberProfiles)
            {
                try
                {
                    Domain.Socioboard.Domain.TeamMemberProfile objTeamMemberProfile = GetTeamMemberProfileFromJObject(item);

                    ISocialSiteAccount objISocialSiteAccount = GetSocialAccountFromTeamMemberProfile(objGroups.UserId, objTeamMemberProfile);
                    SocialSiteAccountFactory objSocialSiteAccountFactory = new SocialSiteAccountFactory(objTeamMemberProfile.ProfileType);
                    dict_TeamMember.Add(objTeamMemberProfile, objISocialSiteAccount);
                }
                catch (Exception ex)
                {

                    Console.WriteLine(ex.Message);
                    //return null;
                }
            }
            return dict_TeamMember;


        }
Beispiel #3
0
        public static Dictionary <Domain.Socioboard.Domain.TeamMemberProfile, object> GetUserProfilesccordingToGroup()
        {
            User objUser = (User)System.Web.HttpContext.Current.Session["User"];
            Dictionary <Domain.Socioboard.Domain.TeamMemberProfile, object> dict_TeamMember = new Dictionary <Domain.Socioboard.Domain.TeamMemberProfile, object>();

            Api.Team.Team objApiTeam = new Api.Team.Team();
            JObject       team       = JObject.Parse(objApiTeam.GetTeamByGroupId(System.Web.HttpContext.Current.Session["group"].ToString()));

            Api.TeamMemberProfile.TeamMemberProfile objApiTeamMemberProfile = new Api.TeamMemberProfile.TeamMemberProfile();
            JArray TeamMemberProfiles = JArray.Parse(objApiTeamMemberProfile.GetTeamMemberProfilesByTeamId(Convert.ToString(team["Id"])));

            foreach (var item in TeamMemberProfiles)
            {
                try
                {
                    Domain.Socioboard.Domain.TeamMemberProfile objTeamMemberProfile = GetTeamMemberProfileFromJObject(item);

                    ISocialSiteAccount       objISocialSiteAccount       = GetSocialAccountFromTeamMemberProfile(objUser, objTeamMemberProfile);
                    SocialSiteAccountFactory objSocialSiteAccountFactory = new SocialSiteAccountFactory(objTeamMemberProfile.ProfileType);
                    dict_TeamMember.Add(objTeamMemberProfile, objISocialSiteAccount);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                    //return null;
                }
            }
            return(dict_TeamMember);
        }
        public ActionResult accordianprofiles()
        {
            Api.Team.Team objApiTeam = new Api.Team.Team();
            string groupid = Session["group"].ToString();
            Domain.Socioboard.Domain.Team team = (Domain.Socioboard.Domain.Team)new JavaScriptSerializer().Deserialize(objApiTeam.GetTeamByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Team));


            Api.TeamMemberProfile.TeamMemberProfile objApiTeamMemberProfile = new Api.TeamMemberProfile.TeamMemberProfile();
            List<Domain.Socioboard.Domain.TeamMemberProfile> alstprofiles = (List<Domain.Socioboard.Domain.TeamMemberProfile>)new JavaScriptSerializer().Deserialize(objApiTeamMemberProfile.GetTeamMemberProfilesByTeamId(team.Id.ToString()), typeof(List<Domain.Socioboard.Domain.TeamMemberProfile>));

            return PartialView("_MessagesRightPartial", alstprofiles);//Content(view_MessagesaccordianprofilesPartial);
        }
        public static List<Domain.Socioboard.Domain.TeamMemberProfile> GetUserTeamMemberProfiles()
        {
            User objUser = (User)System.Web.HttpContext.Current.Session["User"];
            string groupid = System.Web.HttpContext.Current.Session["group"].ToString();

            List<Domain.Socioboard.Domain.TeamMemberProfile> lstTeamMemberProfile = new List<Domain.Socioboard.Domain.TeamMemberProfile>();
            
            Api.Team.Team objApiTeam = new Api.Team.Team();
            objApiTeam.Timeout = 300000;
            JObject team = JObject.Parse(objApiTeam.GetTeamByGroupId(System.Web.HttpContext.Current.Session["group"].ToString()));

            Api.TeamMemberProfile.TeamMemberProfile objApiTeamMemberProfile = new Api.TeamMemberProfile.TeamMemberProfile();
            objApiTeamMemberProfile.Timeout = 300000;
            JArray TeamMemberProfiles = JArray.Parse(objApiTeamMemberProfile.GetTeamMemberProfilesByTeamId(Convert.ToString(team["Id"])));

            foreach (var item in TeamMemberProfiles)
            {
                try
                {
                    Domain.Socioboard.Domain.TeamMemberProfile objTeamMemberProfile = GetTeamMemberProfileFromJObject(item);
                    lstTeamMemberProfile.Add(objTeamMemberProfile);
                }
                catch (Exception ex)
                {

                    Console.WriteLine(ex.Message);
                    //return null;
                }
            }
            return lstTeamMemberProfile;


        }
        public static GroupStatDetails GetGroupStatsData(int days)
        {
            GroupStatDetails _GroupStatDetails = new GroupStatDetails();
            try
            {

                User objUser = (User)System.Web.HttpContext.Current.Session["User"];
                List<Domain.Socioboard.Domain.TeamMemberProfile> lstTeamMemberProfile = new List<Domain.Socioboard.Domain.TeamMemberProfile>();
                Api.Team.Team objApiTeam = new Api.Team.Team();
                objApiTeam.Timeout = 300000;
                string groupid = System.Web.HttpContext.Current.Session["group"].ToString();
                JObject team = JObject.Parse(objApiTeam.GetTeamByGroupId(System.Web.HttpContext.Current.Session["group"].ToString()));
                Api.TeamMemberProfile.TeamMemberProfile objApiTeamMemberProfile = new Api.TeamMemberProfile.TeamMemberProfile();
                objApiTeamMemberProfile.Timeout = 300000;
                //JArray TeamMemberProfiles = JArray.Parse(objApiTeamMemberProfile.GetTeamMemberProfilesByTeamId(Convert.ToString(team["Id"])));

                //  var asd=  objApiTeamMemberProfile.GetTeamMembeDetailsForGroupReport(Convert.ToString(team["Id"]), objUser.Id.ToString(), days.ToString());

                _GroupStatDetails = (GroupStatDetails)(new JavaScriptSerializer().Deserialize(objApiTeamMemberProfile.GetTeamMembeDetailsForGroupReport(Convert.ToString(team["Id"]), objUser.Id.ToString(), days.ToString()), typeof(GroupStatDetails)));


            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
            }


            return _GroupStatDetails;
        }
        //public static string CompareDateWithclient(string clientdate, string scheduletime)
        //{
        //    DateTime client = Convert.ToDateTime(clientdate);
        //    string strTimeNow = String.Format("{0:s}", client).Replace('T', ' ');

        //    DateTime server = DateTime.Now;
        //    DateTime schedule = Convert.ToDateTime(scheduletime);
        //    if (DateTime.Compare(client, server) > 0)
        //    {

        //        double minutes = (server - client).TotalMinutes;
        //        schedule = schedule.AddMinutes(minutes);

        //    }
        //    else if (DateTime.Compare(client, server) == 0)
        //    {


        //    }
        //    else if (DateTime.Compare(client, server) < 0)
        //    {
        //        double minutes = (server - client).TotalMinutes;
        //        schedule = schedule.AddMinutes(-minutes);
        //    }
        //    return schedule.ToString();
        //}

        public static Domain.Socioboard.Domain.Team GetTeamFromGroupId()
        {
            Api.Team.Team objApiTeam = new Api.Team.Team();
            objApiTeam.Timeout = 300000;
            string groupid = HttpContext.Current.Session["group"].ToString();
            Domain.Socioboard.Domain.Team team = (Domain.Socioboard.Domain.Team)new JavaScriptSerializer().Deserialize(objApiTeam.GetTeamByGroupId(HttpContext.Current.Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Team));
            return team;
        }
        public ActionResult DeleteAccount()
        {

            string type = Request.QueryString["profile"].ToString();
            string profileid = Request.QueryString["profileid"].ToString();
            Domain.Socioboard.Domain.User objUser = (Domain.Socioboard.Domain.User)Session["User"];

            // Edited By Antima[15/12/2014]
            string GroupId = Session["group"].ToString();
            Api.Team.Team objApiTeam = new Api.Team.Team();
            objApiTeam.Timeout = 300000;
            Domain.Socioboard.Domain.Team team = (Domain.Socioboard.Domain.Team)new JavaScriptSerializer().Deserialize(objApiTeam.GetTeamByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Team));
            Guid AdminUserId = team.UserId;
            try
            {
                if (AdminUserId == objUser.Id)
                {
                    if (type == "fb")
                    {
                        Api.FacebookAccount.FacebookAccount ApiobjFacebookAccount = new Api.FacebookAccount.FacebookAccount();
                        ApiobjFacebookAccount.DeleteFacebookAccount(objUser.Id.ToString(), profileid, Session["group"].ToString());
                    }
                    else if (type == "twt")
                    {
                        Api.TwitterAccount.TwitterAccount apiobjTwitterAccount = new Api.TwitterAccount.TwitterAccount();
                        apiobjTwitterAccount.DeleteTwitterAccount(objUser.Id.ToString(), profileid, Session["group"].ToString());
                    }
                    else if (type == "linkedin")
                    {
                        Api.LinkedinAccount.LinkedinAccount apiobjLinkedinAccount = new Api.LinkedinAccount.LinkedinAccount();
                        apiobjLinkedinAccount.DeleteLinkedinAccount(objUser.Id.ToString(), profileid, Session["group"].ToString());
                    }
                    else if (type == "instagram")
                    {
                        Api.InstagramAccount.InstagramAccount apiobjInstagramAccount = new Api.InstagramAccount.InstagramAccount();
                        apiobjInstagramAccount.DeleteInstagramAccount(objUser.Id.ToString(), profileid, Session["group"].ToString());
                    }
                    else if (type == "tumblr")
                    {
                        Api.TumblrAccount.TumblrAccount apiobjTumblrAccount = new Api.TumblrAccount.TumblrAccount();
                        apiobjTumblrAccount.DeleteTumblrAccount(objUser.Id.ToString(), profileid, Session["group"].ToString());
                    }
                    else if (type == "youtube")
                    {
                        Api.YoutubeAccount.YoutubeAccount apiobjYoutubeAccount = new Api.YoutubeAccount.YoutubeAccount();
                        apiobjYoutubeAccount.DeleteYoutubeAccount(objUser.Id.ToString(), profileid, Session["group"].ToString());
                    }
                    else if (type == "liComPage")
                    {
                        Api.LinkedinCompanyPage.LinkedinCompanyPage apiobjLinkedinCompanyPage = new Api.LinkedinCompanyPage.LinkedinCompanyPage();
                        apiobjLinkedinCompanyPage.DeleteLinkedinCompanyPage(objUser.Id.ToString(), profileid, Session["group"].ToString());
                    }
                    else if (type == "gplus")
                    {
                        Api.GooglePlusAccount.GooglePlusAccount objGooglePlusAccount = new Api.GooglePlusAccount.GooglePlusAccount();
                        objGooglePlusAccount.DeleteGplusAccount(objUser.Id.ToString(), profileid, Session["group"].ToString());
                        
                    }
                    return Content("Deleted");
                }
                else
                {
                    return Content("Not Deleted");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                return Content("Not Deleted");
            }
        }
        public static List<Domain.Myfashion.Domain.TeamMemberProfile> GetUserTeamMemberProfiles()
        {
            User objUser = (User)System.Web.HttpContext.Current.Session["User"];
            string groupid = System.Web.HttpContext.Current.Session["group"].ToString();

            List<Domain.Myfashion.Domain.TeamMemberProfile> lstTeamMemberProfile = new List<Domain.Myfashion.Domain.TeamMemberProfile>();
            
            Api.Team.Team objApiTeam = new Api.Team.Team();
            objApiTeam.Timeout = 300000;
            JObject team = JObject.Parse(objApiTeam.GetTeamByGroupId(System.Web.HttpContext.Current.Session["group"].ToString()));

            Api.TeamMemberProfile.TeamMemberProfile objApiTeamMemberProfile = new Api.TeamMemberProfile.TeamMemberProfile();
            objApiTeamMemberProfile.Timeout = 300000;
            //JArray TeamMemberProfiles = JArray.Parse(objApiTeamMemberProfile.GetTeamMemberProfilesByTeamId(Convert.ToString(team["Id"])));
            lstTeamMemberProfile = (List<Domain.Myfashion.Domain.TeamMemberProfile>)new JavaScriptSerializer().Deserialize(objApiTeamMemberProfile.GetTeamMemberProfilesByTeamId(Convert.ToString(team["Id"])), typeof(List<Domain.Myfashion.Domain.TeamMemberProfile>));
            //foreach (var item in TeamMemberProfiles)
            //{
            //    try
            //    {
            //        Domain.Myfashion.Domain.TeamMemberProfile objTeamMemberProfile = GetTeamMemberProfileFromJObject(item);
            //        lstTeamMemberProfile.Add(objTeamMemberProfile);
            //    }
            //    catch (Exception ex)
            //    {

            //        Console.WriteLine(ex.Message);
            //        //return null;
            //    }
            //}
            return lstTeamMemberProfile;


        }
Beispiel #10
0
        public ActionResult accordianprofiles()
        {
            Api.Team.Team objApiTeam = new Api.Team.Team();
            string        groupid    = Session["group"].ToString();

            Domain.Socioboard.Domain.Team team = (Domain.Socioboard.Domain.Team) new JavaScriptSerializer().Deserialize(objApiTeam.GetTeamByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Team));


            Api.TeamMemberProfile.TeamMemberProfile           objApiTeamMemberProfile = new Api.TeamMemberProfile.TeamMemberProfile();
            List <Domain.Socioboard.Domain.TeamMemberProfile> alstprofiles            = (List <Domain.Socioboard.Domain.TeamMemberProfile>) new JavaScriptSerializer().Deserialize(objApiTeamMemberProfile.GetTeamMemberProfilesByTeamId(team.Id.ToString()), typeof(List <Domain.Socioboard.Domain.TeamMemberProfile>));

            return(View("_MessagesRightPartial", alstprofiles));//Content(view_MessagesaccordianprofilesPartial);
        }
Beispiel #11
0
        public static List<Domain.Socioboard.Domain.TeamMemberProfile> GetUserTeamMemberTwitterProfiles()
        {
            User objUser = (User)System.Web.HttpContext.Current.Session["User"];
            string groupid = System.Web.HttpContext.Current.Session["group"].ToString();

            List<Domain.Socioboard.Domain.TeamMemberProfile> lstTeamMemberProfile = new List<Domain.Socioboard.Domain.TeamMemberProfile>();

            Api.Team.Team objApiTeam = new Api.Team.Team();
            objApiTeam.Timeout = 300000;
            JObject team = JObject.Parse(objApiTeam.GetTeamByGroupId(System.Web.HttpContext.Current.Session["group"].ToString()));

            Api.TeamMemberProfile.TeamMemberProfile objApiTeamMemberProfile = new Api.TeamMemberProfile.TeamMemberProfile();
            objApiTeamMemberProfile.Timeout = 300000;
            lstTeamMemberProfile = (List<Domain.Socioboard.Domain.TeamMemberProfile>)new JavaScriptSerializer().Deserialize(objApiTeamMemberProfile.GetTeamMemberTwitterProfilesByTeamId(Convert.ToString(team["Id"])), typeof(List<Domain.Socioboard.Domain.TeamMemberProfile>));

            return lstTeamMemberProfile;
        }
Beispiel #12
0
        public static List<Domain.Socioboard.Domain.InstagramAccount> GetUserTeamMemberInstaProfiles()
        {
            User objUser = (User)System.Web.HttpContext.Current.Session["User"];
            string groupid = System.Web.HttpContext.Current.Session["group"].ToString();
            Api.InstagramAccount.InstagramAccount ApiInstaAccount = new Api.InstagramAccount.InstagramAccount();
            List<Domain.Socioboard.Domain.TeamMemberProfile> lstTeamMemberProfile = new List<Domain.Socioboard.Domain.TeamMemberProfile>();
            List<Domain.Socioboard.Domain.InstagramAccount> ret_InstaProfile = new List<Domain.Socioboard.Domain.InstagramAccount>();
            Domain.Socioboard.Domain.InstagramAccount _InstaAccount = new Domain.Socioboard.Domain.InstagramAccount();

            Api.Team.Team objApiTeam = new Api.Team.Team();
            objApiTeam.Timeout = 300000;
            JObject team = JObject.Parse(objApiTeam.GetTeamByGroupId(System.Web.HttpContext.Current.Session["group"].ToString()));
            Api.TeamMemberProfile.TeamMemberProfile objApiTeamMemberProfile = new Api.TeamMemberProfile.TeamMemberProfile();
            objApiTeamMemberProfile.Timeout = 300000;
            lstTeamMemberProfile = (List<Domain.Socioboard.Domain.TeamMemberProfile>)new JavaScriptSerializer().Deserialize(objApiTeamMemberProfile.GetTeamMemberProfilesByTeamId(Convert.ToString(team["Id"])), typeof(List<Domain.Socioboard.Domain.TeamMemberProfile>));

            foreach (Domain.Socioboard.Domain.TeamMemberProfile team_member in lstTeamMemberProfile)
            {
                _InstaAccount = (Domain.Socioboard.Domain.InstagramAccount)new JavaScriptSerializer().Deserialize(ApiInstaAccount.UserInformation(objUser.Id.ToString(), team_member.ProfileId), typeof(Domain.Socioboard.Domain.InstagramAccount));

                if (team_member.ProfileType == "instagram" && !string.IsNullOrEmpty(_InstaAccount.AccessToken))
                {
                    ret_InstaProfile.Add(_InstaAccount);
                }
            }
            return ret_InstaProfile;

        }
 public ActionResult BindUserProfileByGroupChat()
 {
     Api.Team.Team objApiTeam = new Api.Team.Team();
     string groupid = Session["group"].ToString();
     Domain.Socioboard.Domain.Team team = (Domain.Socioboard.Domain.Team)new JavaScriptSerializer().Deserialize(objApiTeam.GetTeamByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Team));
     Api.TeamMemberProfile.TeamMemberProfile objApiTeamMemberProfile = new Api.TeamMemberProfile.TeamMemberProfile();
     List<Domain.Socioboard.Domain.TeamMemberProfile> alstprofiles = (List<Domain.Socioboard.Domain.TeamMemberProfile>)new JavaScriptSerializer().Deserialize(objApiTeamMemberProfile.GetTeamMemberProfilesByTeamId(team.Id.ToString()), typeof(List<Domain.Socioboard.Domain.TeamMemberProfile>));
     return PartialView("_InboxChatProfilePartial", alstprofiles);
 }
        public ActionResult DeleteAccount()
        {
            string type      = Request.QueryString["profile"].ToString();
            string profileid = Request.QueryString["profileid"].ToString();

            Domain.Socioboard.Domain.User objUser = (Domain.Socioboard.Domain.User)Session["User"];

            // Edited By Antima[15/12/2014]
            string GroupId = Session["group"].ToString();

            Api.Team.Team objApiTeam = new Api.Team.Team();
            objApiTeam.Timeout = 300000;
            Domain.Socioboard.Domain.Team team = (Domain.Socioboard.Domain.Team) new JavaScriptSerializer().Deserialize(objApiTeam.GetTeamByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Team));
            Guid AdminUserId = team.UserId;

            try
            {
                if (AdminUserId == objUser.Id)
                {
                    if (type == "fb")
                    {
                        Api.FacebookAccount.FacebookAccount ApiobjFacebookAccount = new Api.FacebookAccount.FacebookAccount();
                        ApiobjFacebookAccount.DeleteFacebookAccount(objUser.Id.ToString(), profileid, Session["group"].ToString());
                    }
                    else if (type == "twt")
                    {
                        Api.TwitterAccount.TwitterAccount apiobjTwitterAccount = new Api.TwitterAccount.TwitterAccount();
                        apiobjTwitterAccount.DeleteTwitterAccount(objUser.Id.ToString(), profileid, Session["group"].ToString());
                    }
                    else if (type == "linkedin")
                    {
                        Api.LinkedinAccount.LinkedinAccount apiobjLinkedinAccount = new Api.LinkedinAccount.LinkedinAccount();
                        apiobjLinkedinAccount.DeleteLinkedinAccount(objUser.Id.ToString(), profileid, Session["group"].ToString());
                    }
                    else if (type == "instagram")
                    {
                        Api.InstagramAccount.InstagramAccount apiobjInstagramAccount = new Api.InstagramAccount.InstagramAccount();
                        apiobjInstagramAccount.DeleteInstagramAccount(objUser.Id.ToString(), profileid, Session["group"].ToString());
                    }
                    else if (type == "tumblr")
                    {
                        Api.TumblrAccount.TumblrAccount apiobjTumblrAccount = new Api.TumblrAccount.TumblrAccount();
                        apiobjTumblrAccount.DeleteTumblrAccount(objUser.Id.ToString(), profileid, Session["group"].ToString());
                    }
                    else if (type == "youtube")
                    {
                        Api.YoutubeAccount.YoutubeAccount apiobjYoutubeAccount = new Api.YoutubeAccount.YoutubeAccount();
                        apiobjYoutubeAccount.DeleteYoutubeAccount(objUser.Id.ToString(), profileid, Session["group"].ToString());
                    }
                    else if (type == "liComPage")
                    {
                        Api.LinkedinCompanyPage.LinkedinCompanyPage apiobjLinkedinCompanyPage = new Api.LinkedinCompanyPage.LinkedinCompanyPage();
                        apiobjLinkedinCompanyPage.DeleteLinkedinCompanyPage(objUser.Id.ToString(), profileid, Session["group"].ToString());
                    }
                    else if (type == "gplus")
                    {
                        Api.GooglePlusAccount.GooglePlusAccount objGooglePlusAccount = new Api.GooglePlusAccount.GooglePlusAccount();
                        objGooglePlusAccount.DeleteGplusAccount(objUser.Id.ToString(), profileid, Session["group"].ToString());
                    }
                    return(Content("Deleted"));
                }
                else
                {
                    return(Content("Not Deleted"));
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                return(Content("Not Deleted"));
            }
        }
Beispiel #15
0
        public static List<Domain.Socioboard.Domain.GoogleAnalyticsAccount> GetUserTeamMemberGAProfiles()
        {
            User objUser = (User)System.Web.HttpContext.Current.Session["User"];
            string groupid = System.Web.HttpContext.Current.Session["group"].ToString();
            Api.GoogleAnalyticsAccount.GoogleAnalyticsAccount ApiGoogleAnalyticsAccount = new Api.GoogleAnalyticsAccount.GoogleAnalyticsAccount();
            List<Domain.Socioboard.Domain.TeamMemberProfile> lstTeamMemberProfile = new List<Domain.Socioboard.Domain.TeamMemberProfile>();
            List<Domain.Socioboard.Domain.GoogleAnalyticsAccount> ret_GoogleAnalyticsAccount = new List<Domain.Socioboard.Domain.GoogleAnalyticsAccount>();
            Domain.Socioboard.Domain.GoogleAnalyticsAccount _GoogleAnalyticsAccount = new Domain.Socioboard.Domain.GoogleAnalyticsAccount();

            Api.Team.Team objApiTeam = new Api.Team.Team();
            objApiTeam.Timeout = 300000;
            JObject team = JObject.Parse(objApiTeam.GetTeamByGroupId(System.Web.HttpContext.Current.Session["group"].ToString()));
            Api.TeamMemberProfile.TeamMemberProfile objApiTeamMemberProfile = new Api.TeamMemberProfile.TeamMemberProfile();
            objApiTeamMemberProfile.Timeout = 300000;
            lstTeamMemberProfile = (List<Domain.Socioboard.Domain.TeamMemberProfile>)new JavaScriptSerializer().Deserialize(objApiTeamMemberProfile.GetTeamMemberProfilesByTeamId(Convert.ToString(team["Id"])), typeof(List<Domain.Socioboard.Domain.TeamMemberProfile>));

            foreach (Domain.Socioboard.Domain.TeamMemberProfile team_member in lstTeamMemberProfile)
            {
                if (team_member.ProfileType == "googleanalytics")
                {
                    _GoogleAnalyticsAccount = (Domain.Socioboard.Domain.GoogleAnalyticsAccount)new JavaScriptSerializer().Deserialize(ApiGoogleAnalyticsAccount.GetGooglePlusAccountDetailsById(objUser.Id.ToString(), team_member.ProfileId), typeof(Domain.Socioboard.Domain.GoogleAnalyticsAccount));
                    ret_GoogleAnalyticsAccount.Add(_GoogleAnalyticsAccount);
                }
            }
            return ret_GoogleAnalyticsAccount;
        }
Beispiel #16
0
        public static async Task<Dictionary<Domain.Socioboard.Domain.TeamMemberProfile, object>> GetUserProfilesccordingToGroup()
        {
            User objUser = (User)System.Web.HttpContext.Current.Session["User"];
            Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups();
           // ApiobjGroups.Timeout = 300000;
            //ApiobjGroups.GetGroupDetailsByGroupId
            //Groups objGroups = (Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(System.Web.HttpContext.Current.Session["group"].ToString()), typeof(Groups)));
            Groups objGroups = null;
            HttpResponseMessage response = await WebApiReq.GetReq("api/ApiGroups/GetGroupDetailsByGroupId?GroupId=" + System.Web.HttpContext.Current.Session["group"].ToString(), "Bearer", System.Web.HttpContext.Current.Session["access_token"].ToString());
            if (response.IsSuccessStatusCode)
            {
                objGroups = await response.Content.ReadAsAsync<Domain.Socioboard.Domain.Groups>();
            }



            Dictionary<Domain.Socioboard.Domain.TeamMemberProfile, object> dict_TeamMember = new Dictionary<Domain.Socioboard.Domain.TeamMemberProfile, object>();

            Api.Team.Team objApiTeam = new Api.Team.Team();
            objApiTeam.Timeout = 300000;
            JObject team = JObject.Parse(objApiTeam.GetTeamByGroupId(System.Web.HttpContext.Current.Session["group"].ToString()));
            Api.TeamMemberProfile.TeamMemberProfile objApiTeamMemberProfile = new Api.TeamMemberProfile.TeamMemberProfile();
            objApiTeamMemberProfile.Timeout = 300000;
            //JArray TeamMemberProfiles = JArray.Parse(objApiTeamMemberProfile.GetTeamMemberProfilesByTeamId(Convert.ToString(team["Id"])));

            List<Domain.Socioboard.Domain.TeamMemberProfile> lstTeamMemberProfiles = (List<Domain.Socioboard.Domain.TeamMemberProfile>)new JavaScriptSerializer().Deserialize(objApiTeamMemberProfile.GetTeamMemberProfilesByTeamId(Convert.ToString(team["Id"])), typeof(List<Domain.Socioboard.Domain.TeamMemberProfile>));

            //foreach (var item in TeamMemberProfiles)
            //{
            //    try
            //    {
            //        Domain.Socioboard.Domain.TeamMemberProfile objTeamMemberProfile = GetTeamMemberProfileFromJObject(item);

            //        ISocialSiteAccount objISocialSiteAccount = GetSocialAccountFromTeamMemberProfile(objGroups.UserId, objTeamMemberProfile);
            //        SocialSiteAccountFactory objSocialSiteAccountFactory = new SocialSiteAccountFactory(objTeamMemberProfile.ProfileType);
            //        dict_TeamMember.Add(objTeamMemberProfile, objISocialSiteAccount);
            //    }
            //    catch (Exception ex)
            //    {

            //        Console.WriteLine(ex.Message);
            //        //return null;
            //    }
            //}

            foreach (Domain.Socioboard.Domain.TeamMemberProfile objTeamMemberProfile in lstTeamMemberProfiles)
            {
                try
                {
                    ISocialSiteAccount objISocialSiteAccount = GetSocialAccountFromTeamMemberProfile(objGroups.UserId, objTeamMemberProfile);
                    SocialSiteAccountFactory objSocialSiteAccountFactory = new SocialSiteAccountFactory(objTeamMemberProfile.ProfileType);
                    dict_TeamMember.Add(objTeamMemberProfile, objISocialSiteAccount);
                }
                catch (Exception ex)
                {
                    logger.Error(ex.Message);
                }
            }
            return dict_TeamMember;


        }