Esempio n. 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 ActionResult AddTeamMember(string email)
        {
            User   objUser         = (User)Session["User"];
            string selectedgroupid = Session["selectedgroupid"].ToString();

            Api.Team.Team ApiobjTeam  = new Api.Team.Team();
            Api.User.User ApiobjUser  = new Api.User.User();
            User          objuserinfo = (User)(new JavaScriptSerializer().Deserialize(ApiobjUser.getUserInfoByEmail(email), typeof(User)));

            if (objuserinfo != null)
            {
                string[] name  = objuserinfo.UserName.Split(' ');
                string   fname = name[0];
                string   lname = string.Empty;
                for (int i = 1; i < name.Length; i++)
                {
                    lname += name[i];
                }
                ApiobjTeam.AddTeam(objuserinfo.Id.ToString(), "0", fname, lname, email, "", selectedgroupid, objUser.EmailId, objUser.UserName);
            }
            else
            {
                ApiobjTeam.AddTeam(Guid.NewGuid().ToString(), "0", "", "", email, "", selectedgroupid, objUser.EmailId, objUser.UserName);
            }
            return(Content("_AcceptedUserPartial"));
        }
Esempio n. 3
0
        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;


        }
Esempio n. 4
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 PendingUser(string Groupid)
        {
            User   objUser         = (User)Session["User"];
            string selectedgroupid = Session["selectedgroupid"].ToString();

            Api.Team.Team ApiobjTeam = new Api.Team.Team();
            List <Domain.Socioboard.Domain.Team> lstteam = (List <Domain.Socioboard.Domain.Team>)(new JavaScriptSerializer().Deserialize(ApiobjTeam.GetTeamByStatus(selectedgroupid, objUser.Id.ToString(), "0"), typeof(List <Domain.Socioboard.Domain.Team>)));

            return(PartialView("_PendingUserPartial", lstteam));
        }
        public async Task <ActionResult> BindFacebookProfiles(string type)
        {
            Api.Team.Team objApiTeam = new Api.Team.Team();
            ViewBag.type = type;
            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>));
            Dictionary <Domain.Socioboard.Domain.GroupProfile, object> alstprofiles = await SBHelper.GetGroupProfilesByGroupId(groupid);

            return(PartialView("_FacebookProfilePartial", alstprofiles));
        }
        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);
        }
Esempio n. 8
0
        public ActionResult Index()
        {
            if (Request.QueryString["teamid"] != null)
            {
                string        teamid   = Request.QueryString["teamid"].ToString();
                Api.Team.Team _apiteam = new Api.Team.Team();
                _apiteam.UpdateTeambyteamid(teamid);
            }
            if (Session["Paid_User"] != null && Session["Paid_User"].ToString() == "Unpaid")
            {
                return(RedirectToAction("Billing", "PersonalSetting"));
            }

            else
            {
                ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";
                #region Count Used Accounts
                try
                {
                    User objUser = (User)Session["User"];
                    Api.SocialProfile.SocialProfile apiobjSocialProfile = new Api.SocialProfile.SocialProfile();

                    apiobjSocialProfile.GetAllSocialProfiles();

                    Session["ProfileCount"] = Convert.ToInt16(apiobjSocialProfile.GetAllSocialProfilesOfUserCount(objUser.Id.ToString()).ToString());
                    Session["TotalAccount"] = Convert.ToInt16(SBUtils.GetUserPackageProfileCount(objUser.AccountType));
                    ViewBag.AccountType     = objUser.AccountType;
                    //if (Session["GroupName"] == null)
                    //{
                    //    Groups objGroupDetails = objGroupRepository.getGroupDetail(user.Id);
                    //    team = objTeamRepo.getAllDetails(objGroupDetails.Id, user.EmailId);
                    //    Session["GroupName"] = team;
                    //}

                    //else
                    //{
                    //    team = (SocioBoard.Domain.Team)Session["GroupName"];
                    //}
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
                #endregion
                if (Session["SocialManagerInfo"] != null)
                {
                }
                int ProfileCount = int.Parse(Session["ProfileCount"].ToString());
                return(View(User));
                // return PartialView("_HomePartial");
            }
        }
Esempio n. 9
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);
        }
Esempio n. 10
0
        public ActionResult SignIn()
        {
            Session.Clear();
            Session.RemoveAll();
            User   _user     = (User)Session["User"];
            string str       = "";
            string returnmsg = "";

            try
            {
                logger.Error("Avinash Login");
                User          user      = new Domain.Myfashion.Domain.User();
                string        uname     = Request.QueryString["username"].ToString();
                string        pass      = Request.QueryString["password"].ToString();
                Api.User.User obj       = new Api.User.User();
                string        logindata = obj.Login(uname, pass);
                str = logindata.Replace("\"", string.Empty).Trim();
                if (str != "Not Exist" && !str.Equals("Email Not Exist"))
                {
                    user = (User)(new JavaScriptSerializer().Deserialize(logindata, typeof(User)));
                    Api.Team.Team ApiobjTeam = new Api.Team.Team();
                    List <Domain.Myfashion.Domain.Groups> lstgroup = (List <Domain.Myfashion.Domain.Groups>)(new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize(ApiobjTeam.GetTeamByUserId(user.Id.ToString()), typeof(List <Domain.Myfashion.Domain.Groups>)));
                    foreach (Groups item in lstgroup)
                    {
                        System.Web.HttpContext.Current.Session["group"] = item.Id;
                    }
                    if (user == null)
                    {
                        returnmsg = "Invalid Email or Password";
                    }
                    else
                    {
                        Session["User"] = user;
                        returnmsg       = "user";
                    }
                    return(Content(returnmsg));
                }
                else if (str.Equals("Email Not Exist"))
                {
                    returnmsg = "Sorry, Socioboard doesn't recognize that username.";
                    return(Content(returnmsg));
                }
                return(Content(returnmsg));
            }
            catch (Exception ex)
            {
                logger.Error("UserLogin >>" + ex.Message);
                logger.Error("UserLogin >>" + ex.StackTrace);
                return(Content(str));
            }
        }
Esempio n. 11
0
        public ActionResult LoadRegistration(string teamid)
        {
            string ss      = Request.QueryString["teamid"];
            User   objUser = (User)Session["User"];

            if (!String.IsNullOrEmpty(teamid))
            {
                objUser = new Domain.Socioboard.Domain.User();
                Api.Team.Team ApiobjTeam  = new Api.Team.Team();
                Team          objuserinfo = (Team)(new JavaScriptSerializer().Deserialize(ApiobjTeam.GetTeamById(teamid), typeof(Team)));
                objUser.EmailId = objuserinfo.EmailId;
            }
            return(PartialView("_RegistrationPartial", objUser));
        }
Esempio n. 12
0
        public ActionResult Index(string teamid)
        {
            User objUser = (User)Session["User"];

            if (teamid != null)
            {
                if (objUser != null)
                {
                    Api.Team.Team ApiobjTeam  = new Api.Team.Team();
                    Team          objuserinfo = (Team)(new JavaScriptSerializer().Deserialize(ApiobjTeam.GetTeamById(teamid), typeof(Team)));
                    if (objuserinfo.InviteStatus == 0)
                    {
                        ApiobjTeam.UpdateTeam(objUser.Id.ToString(), teamid, objUser.UserName);
                    }
                    Response.Redirect("../Home/Index", true);
                }
                else
                {
                    //Response.Redirect("Index/Registration?teamid="+teamid +"");
                    return(RedirectToAction("Registration", "Index", new { teamid = teamid }));
                }
            }
            Session["fblogin"] = null;
            ViewBag.Message    = "Modify this template to jump-start your ASP.NET MVC application.";
            #region Count Used Accounts
            try
            {
                Api.SocialProfile.SocialProfile apiobjSocialProfile = new Api.SocialProfile.SocialProfile();

                apiobjSocialProfile.GetAllSocialProfiles();

                Session["ProfileCount"] = Convert.ToInt16(apiobjSocialProfile.GetAllSocialProfilesOfUserCount(objUser.Id.ToString()).ToString());
                Session["TotalAccount"] = Convert.ToInt16(SBUtils.GetUserPackageProfileCount(objUser.AccountType));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            #endregion
            if (Session["SocialManagerInfo"] != null)
            {
            }
            return(View(User));
            // return PartialView("_HomePartial");
        }
Esempio n. 13
0
 //
 // GET: /Home/
 public ActionResult Index()
 {
     if (Session["User"] != null)
     {
         User   _user = (User)Session["User"];
         string pass  = _user.Password;
         string pid   = _user.PuId;
         string puid  = pid.Substring(36, pid.Length - 36);
         ViewBag.PuId = puid;
         ViewBag.user = _user;
         Api.Team.Team ApiobjTeam = new Api.Team.Team();
         List <Domain.Myfashion.Domain.Groups> lstgroup = (List <Domain.Myfashion.Domain.Groups>)(new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize(ApiobjTeam.GetTeamByUserId(_user.Id.ToString()), typeof(List <Domain.Myfashion.Domain.Groups>)));
         foreach (Groups item in lstgroup)
         {
             System.Web.HttpContext.Current.Session["group"] = item.Id;
         }
         return(View());
     }
     else
     {
         return(RedirectToAction("Index", "Index"));
     }
 }
        //
        // GET: /Home/
        public ActionResult Index()
        {

            if (Session["User"] != null)
            {
                User _user = (User)Session["User"];
                string pass = _user.Password;
                string pid = _user.PuId;
                string puid = pid.Substring(36, pid.Length - 36);
                ViewBag.PuId = puid;
                ViewBag.user = _user;
                Api.Team.Team ApiobjTeam = new Api.Team.Team();
                List<Domain.Myfashion.Domain.Groups> lstgroup = (List<Domain.Myfashion.Domain.Groups>)(new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize(ApiobjTeam.GetTeamByUserId(_user.Id.ToString()), typeof(List<Domain.Myfashion.Domain.Groups>)));
                foreach (Groups item in lstgroup)
                {
                    System.Web.HttpContext.Current.Session["group"] = item.Id;
                }
                return View();
            }
            else
            {
                return RedirectToAction("Index", "Index");
            }
        }
Esempio n. 15
0
 public ActionResult LoadRegistration(string teamid)
 {
     string ss = Request.QueryString["teamid"];
     User objUser = (User)Session["User"];
     if (!String.IsNullOrEmpty(teamid))
     {
         objUser = new Domain.Socioboard.Domain.User();
         Api.Team.Team ApiobjTeam = new Api.Team.Team();
         Team objuserinfo = (Team)(new JavaScriptSerializer().Deserialize(ApiobjTeam.GetTeamById(teamid), typeof(Team)));
         objUser.EmailId = objuserinfo.EmailId;
     }
     return PartialView("_RegistrationPartial", objUser);
 }
Esempio n. 16
0
        public ActionResult Index()
        {
            if (Session["User"] != null)
            {
                User objUser = (User)Session["User"];
                if (TempData["IsTwitterAccountAdded"] != null && TempData["TwitterAccount"] != null)
                {   
                    //To enable the Tweet Pop up
                    ViewBag.IsTwitterAccountAdded = TempData["IsTwitterAccountAdded"];
                    ViewBag.TwitterAccount = TempData["TwitterAccount"];
                }
                if (TempData["IsFacebookAccountAdded"] != null && TempData["FacebookAccount"] != null)
                {
                    //To enable the Tweet Pop up
                    ViewBag.IsFacebookAccountAdded = TempData["IsFacebookAccountAdded"];
                    ViewBag.FacebookAccount = TempData["FacebookAccount"];
                }

                if (Request.QueryString["teamid"] != null)
                {
                    string teamid = Request.QueryString["teamid"].ToString();
                    Api.Team.Team _apiteam = new Api.Team.Team();
                    _apiteam.Timeout = 300000;
                    _apiteam.UpdateTeambyteamid(teamid);

                }
                if (Session["Paid_User"] != null && Session["Paid_User"].ToString() == "Unpaid")
                {
                    return RedirectToAction("Billing", "PersonalSetting");
                }

                else
                {
                    ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";
                    #region Count Used Accounts
                    try
                    {
                        objUser = (User)Session["User"];
                        Api.SocialProfile.SocialProfile apiobjSocialProfile = new Api.SocialProfile.SocialProfile();
                        apiobjSocialProfile.Timeout = 300000;
                        //apiobjSocialProfile.GetAllSocialProfiles();

                        Session["ProfileCount"] = Convert.ToInt16(apiobjSocialProfile.GetAllSocialProfilesOfUserCount(objUser.Id.ToString()).ToString());
                        Session["TotalAccount"] = Convert.ToInt16(SBUtils.GetUserPackageProfileCount(objUser.AccountType));
                        ViewBag.AccountType = objUser.AccountType;
                       
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }
                    #endregion
                    if (Session["SocialManagerInfo"] != null)
                    {

                    }
                    int ProfileCount = int.Parse(Session["ProfileCount"].ToString());
                    if (objUser.ActivationStatus=="1")
                    {
                        return View(User);
                    }
                    else {
                        return RedirectToAction("Index", "Index");
                    }
                }
            }
            else
            {
                return RedirectToAction("Index", "Index");
            }
        }
Esempio n. 17
0
        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");
            }
        }
Esempio n. 18
0
        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;


        }
        public ActionResult SignIn()
        {
            Session.Clear();
            Session.RemoveAll();
            User _user = (User)Session["User"];
             string str="";
             string returnmsg = "";
             try
             {
                 logger.Error("Avinash Login");
                 User user = new Domain.Myfashion.Domain.User();
                 string uname = Request.QueryString["username"].ToString();
                 string pass = Request.QueryString["password"].ToString();
                 Api.User.User obj = new Api.User.User();
                 string logindata = obj.Login(uname, pass);
                 str = logindata.Replace("\"", string.Empty).Trim();
                 if (str != "Not Exist" && !str.Equals("Email Not Exist"))
                 {
                     user = (User)(new JavaScriptSerializer().Deserialize(logindata, typeof(User)));
                     Api.Team.Team ApiobjTeam = new Api.Team.Team();
                     List<Domain.Myfashion.Domain.Groups> lstgroup = (List<Domain.Myfashion.Domain.Groups>)(new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize(ApiobjTeam.GetTeamByUserId(user.Id.ToString()), typeof(List<Domain.Myfashion.Domain.Groups>)));
                     foreach (Groups item in lstgroup)
                     {
                        System.Web.HttpContext.Current.Session["group"] = item.Id;
                     }
                     if (user == null)
                     {
                         returnmsg = "Invalid Email or Password";
                     }
                     else
                     {
                         Session["User"] = user;
                         returnmsg = "user";
                     }
                     return Content(returnmsg);
                     
                 }
                 else if (str.Equals("Email Not Exist"))
                 {
                     returnmsg = "Sorry, Socioboard doesn't recognize that username.";
                     return Content(returnmsg);

                 }
                 return Content(returnmsg);
             }
             catch (Exception ex)
             {
                 logger.Error("UserLogin >>" + ex.Message);
                 logger.Error("UserLogin >>" + ex.StackTrace);
                 return Content(str);

             }

        }
Esempio n. 20
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;

        }
Esempio n. 21
0
        public ActionResult Index()
        {
            if (Session["User"] != null)
            {
                User objUser = (User)Session["User"];
                if (TempData["IsTwitterAccountAdded"] != null && TempData["TwitterAccount"] != null)
                {
                    //To enable the Tweet Pop up
                    ViewBag.IsTwitterAccountAdded = TempData["IsTwitterAccountAdded"];
                    ViewBag.TwitterAccount        = TempData["TwitterAccount"];
                }
                if (TempData["IsFacebookAccountAdded"] != null && TempData["FacebookAccount"] != null)
                {
                    //To enable the Tweet Pop up
                    ViewBag.IsFacebookAccountAdded = TempData["IsFacebookAccountAdded"];
                    ViewBag.FacebookAccount        = TempData["FacebookAccount"];
                }

                if (Request.QueryString["teamid"] != null)
                {
                    string        teamid   = Request.QueryString["teamid"].ToString();
                    Api.Team.Team _apiteam = new Api.Team.Team();
                    _apiteam.Timeout = 300000;
                    _apiteam.UpdateTeambyteamid(teamid);
                }
                if (Session["Paid_User"] != null && Session["Paid_User"].ToString() == "Unpaid")
                {
                    return(RedirectToAction("Billing", "PersonalSetting"));
                }

                else
                {
                    ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";
                    #region Count Used Accounts
                    try
                    {
                        objUser = (User)Session["User"];
                        Api.SocialProfile.SocialProfile apiobjSocialProfile = new Api.SocialProfile.SocialProfile();
                        apiobjSocialProfile.Timeout = 300000;
                        //apiobjSocialProfile.GetAllSocialProfiles();

                        Session["ProfileCount"] = Convert.ToInt16(apiobjSocialProfile.GetAllSocialProfilesOfUserCount(objUser.Id.ToString()).ToString());
                        Session["TotalAccount"] = Convert.ToInt16(SBUtils.GetUserPackageProfileCount(objUser.AccountType));
                        ViewBag.AccountType     = objUser.AccountType;
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }
                    #endregion
                    if (Session["SocialManagerInfo"] != null)
                    {
                    }
                    int ProfileCount = int.Parse(Session["ProfileCount"].ToString());
                    if (objUser.ActivationStatus == "1")
                    {
                        return(View(User));
                    }
                    else
                    {
                        return(RedirectToAction("UserActivationByEmail", "Index", new { email = objUser.EmailId }));
                    }
                }
            }
            else
            {
                return(RedirectToAction("Index", "Index"));
            }
        }
        public async Task<ActionResult> BindUserProfileByGroup()
        {
            Api.Team.Team objApiTeam = new Api.Team.Team();
            string groupId = Session["group"].ToString();
            string accesstoken = string.Empty;
            try
            {
                accesstoken = System.Web.HttpContext.Current.Session["access_token"].ToString();
            }
            catch { }

            IEnumerable<Domain.Socioboard.Domain.GroupProfile> lstGrpProfiles = new List<Domain.Socioboard.Domain.GroupProfile>();
            HttpResponseMessage response1 = await WebApiReq.GetReq("api/ApiGroupProfiles/GetGroupProfiles?GroupId=" + groupId, "Bearer", accesstoken);
            if (response1.IsSuccessStatusCode)
            {
                lstGrpProfiles = await response1.Content.ReadAsAsync<IEnumerable<Domain.Socioboard.Domain.GroupProfile>>();
            }


            //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("_InboxProfilePartial", lstGrpProfiles);
        }
Esempio n. 23
0
        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;


        }
Esempio n. 24
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;


        }
 public async Task<ActionResult> BindFacebookProfiles(string type)
 {
     Api.Team.Team objApiTeam = new Api.Team.Team();
     ViewBag.type = type;
     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>));
     Dictionary<Domain.Socioboard.Domain.GroupProfile, object> alstprofiles = await SBHelper.GetGroupProfilesByGroupId(groupid);
     return PartialView("_FacebookProfilePartial", alstprofiles);
 }
Esempio n. 26
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;
        }
Esempio n. 27
0
        //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 AddTeamMember(string email)
        //{
        //    string response = string.Empty;

        //    User objUser = (User)Session["User"];
        //    string selectedgroupid = Session["selectedgroupid"].ToString();
        //    Api.Team.Team ApiobjTeam = new Api.Team.Team();
        //    Api.User.User ApiobjUser = new Api.User.User();
        //    User objuserinfo = (User)(new JavaScriptSerializer().Deserialize(ApiobjUser.getUserInfoByEmail(email), typeof(User)));
        //    if (objuserinfo != null)
        //    {
        //        string[] name = objuserinfo.UserName.Split(' ');
        //        string fname = name[0];
        //        string lname = string.Empty;
        //        for (int i = 1; i < name.Length; i++)
        //        {
        //            lname += name[i];
        //        }
        //       response = ApiobjTeam.AddTeam(objuserinfo.Id.ToString(), "0", fname, lname, email, "", selectedgroupid, objUser.EmailId, objUser.UserName);
        //    }
        //    else
        //    {
        //        response = ApiobjTeam.AddTeam(Guid.NewGuid().ToString(), "0", "", "", email, "", selectedgroupid, objUser.EmailId, objUser.UserName);
        //    }
        //    //return Content("_AcceptedUserPartial");
        //    return Content(response);
        //}

        // Edited by Antima[6/11/2014]

        public ActionResult AddTeamMember(string email)
        {
            //string[] arr = new string[]{};
            string SentMails = string.Empty;

            try
            {
                List <string> arr             = new List <string>();
                string[]      arr1            = new string[] { };
                string        NotSentMails    = string.Empty;
                User          objUser         = (User)Session["User"];
                string        selectedgroupid = string.Empty;
                if (Session["selectedgroupid"] == null || Session["selectedgroupid"] == "")
                {
                    selectedgroupid = Request.QueryString["groupid"];
                }
                else
                {
                    selectedgroupid = Session["selectedgroupid"].ToString();
                }
                Api.Team.Team ApiobjTeam = new Api.Team.Team();
                Api.User.User ApiobjUser = new Api.User.User();
                if (email.Contains(','))
                {
                    arr = email.Split(',').ToList();
                }
                else
                {
                    //arr[0] = email;
                    arr.Add(email);
                }

                foreach (var item in arr)
                {
                    if (item.Contains(':'))
                    {
                        arr1 = item.Split(':');
                    }

                    string res         = "";
                    User   objuserinfo = (User)(new JavaScriptSerializer().Deserialize(ApiobjUser.getUserInfoByEmail(arr1[0]), typeof(User)));

                    if (objuserinfo != null)
                    {
                        string[] name  = objuserinfo.UserName.Split(' ');
                        string   fname = name[0];
                        string   lname = string.Empty;
                        for (int i = 1; i < name.Length; i++)
                        {
                            lname += name[i];
                        }

                        res = ApiobjTeam.AddTeam(objuserinfo.Id.ToString(), "0", fname, lname, arr1[0], "", selectedgroupid, objUser.EmailId, objUser.UserName);
                    }
                    else
                    {
                        res = ApiobjTeam.AddTeam(objUser.Id.ToString(), "0", arr1[1], arr1[2], arr1[0], "", selectedgroupid, objUser.EmailId, objUser.UserName);
                    }
                    //SentMails += res + ',';

                    if (!string.IsNullOrEmpty(res) && SentMails != "Something Went Wrong")
                    {
                        Domain.Socioboard.Domain.Team objDomainTeam = (Domain.Socioboard.Domain.Team) new JavaScriptSerializer().Deserialize(res, typeof(Domain.Socioboard.Domain.Team));
                        if (objDomainTeam != null)
                        {
                            SentMails += objDomainTeam.EmailId + ',';
                        }
                    }
                    else
                    {
                        NotSentMails += arr1[0] + ',';
                    }
                }
                SentMails = "{\"SentMails\":" + "\"" + SentMails + "\",\"NotSentMails\":" + "\"" + NotSentMails + "\"}";
            }
            catch (Exception ex)
            {
            }

            return(Content(SentMails));
        }
Esempio n. 29
0
        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 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);
 }
Esempio n. 31
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;
        }
 public ActionResult AcceptedUser(string Groupid)
 {
     User objUser = (User)Session["User"];
     string selectedgroupid = Session["selectedgroupid"].ToString();
     Api.Team.Team ApiobjTeam = new Api.Team.Team();
     List<Domain.Socioboard.Domain.Team> lstteam = (List<Domain.Socioboard.Domain.Team>)(new JavaScriptSerializer().Deserialize(ApiobjTeam.GetTeamByStatus(selectedgroupid, objUser.Id.ToString(), "1"), typeof(List<Domain.Socioboard.Domain.Team>)));
     return PartialView("_AcceptedUserPartial", lstteam);
 }
        //public ActionResult AddTeamMember(string email)
        //{
        //    string response = string.Empty;

        //    User objUser = (User)Session["User"];
        //    string selectedgroupid = Session["selectedgroupid"].ToString();
        //    Api.Team.Team ApiobjTeam = new Api.Team.Team();
        //    Api.User.User ApiobjUser = new Api.User.User();
        //    User objuserinfo = (User)(new JavaScriptSerializer().Deserialize(ApiobjUser.getUserInfoByEmail(email), typeof(User)));
        //    if (objuserinfo != null)
        //    {
        //        string[] name = objuserinfo.UserName.Split(' ');
        //        string fname = name[0];
        //        string lname = string.Empty;
        //        for (int i = 1; i < name.Length; i++)
        //        {
        //            lname += name[i];
        //        }
        //       response = ApiobjTeam.AddTeam(objuserinfo.Id.ToString(), "0", fname, lname, email, "", selectedgroupid, objUser.EmailId, objUser.UserName);
        //    }
        //    else
        //    {
        //        response = ApiobjTeam.AddTeam(Guid.NewGuid().ToString(), "0", "", "", email, "", selectedgroupid, objUser.EmailId, objUser.UserName);
        //    }
        //    //return Content("_AcceptedUserPartial");
        //    return Content(response);
        //}

        // Edited by Antima[6/11/2014]

        public ActionResult AddTeamMember(string email)
        {
            //string[] arr = new string[]{};
            string SentMails = string.Empty;
            try
            {
                List<string> arr = new List<string>();
                string[] arr1 = new string[] { };
                string NotSentMails = string.Empty;
                User objUser = (User)Session["User"];
                string selectedgroupid = string.Empty;
                if (Session["selectedgroupid"] == null || Session["selectedgroupid"] == "")
                {
                    selectedgroupid = Request.QueryString["groupid"];
                }
                else
                {
                    selectedgroupid = Session["selectedgroupid"].ToString();
                }
                Api.Team.Team ApiobjTeam = new Api.Team.Team();
                Api.User.User ApiobjUser = new Api.User.User();
                if (email.Contains(','))
                {
                    arr = email.Split(',').ToList();
                }
                else
                {
                    //arr[0] = email;
                    arr.Add(email);
                }

                foreach (var item in arr)
                {
                    if (item.Contains(':'))
                    {
                        arr1 = item.Split(':');
                    }

                    string res = "";
                    User objuserinfo = (User)(new JavaScriptSerializer().Deserialize(ApiobjUser.getUserInfoByEmail(arr1[0]), typeof(User)));

                    if (objuserinfo != null)
                    {
                        string[] name = objuserinfo.UserName.Split(' ');
                        string fname = name[0];
                        string lname = string.Empty;
                        for (int i = 1; i < name.Length; i++)
                        {
                            lname += name[i];
                        }

                        res = ApiobjTeam.AddTeam(objuserinfo.Id.ToString(), "0", fname, lname, arr1[0], "", selectedgroupid, objUser.EmailId, objUser.UserName);
                    }
                    else
                    {
                        res = ApiobjTeam.AddTeam(objUser.Id.ToString(), "0", arr1[1], arr1[2], arr1[0], "", selectedgroupid, objUser.EmailId, objUser.UserName);
                    }
                    //SentMails += res + ',';

                    if (!string.IsNullOrEmpty(res) && SentMails != "Something Went Wrong")
                    {
                        Domain.Socioboard.Domain.Team objDomainTeam = (Domain.Socioboard.Domain.Team)new JavaScriptSerializer().Deserialize(res, typeof(Domain.Socioboard.Domain.Team));
                        if (objDomainTeam != null)
                        {
                            SentMails += objDomainTeam.EmailId + ',';
                        }
                    }
                    else
                    {
                        NotSentMails += arr1[0] + ',';
                    }
                }
                SentMails = "{\"SentMails\":" + "\"" + SentMails + "\",\"NotSentMails\":" + "\"" + NotSentMails + "\"}";
            }
            catch (Exception ex)
            {
            }

            return Content(SentMails);
        }
Esempio n. 34
0
        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"));
            }
        }