Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    User user = (User)Session["LoggedUser"];

                    if (user == null)
                    {
                        Response.Redirect("/Default.aspx");
                    }


                    ArrayList arrFacebookAccount = fbAccRepo.getAllFacebookPagesOfUser(user.Id);

                    foreach (var item in arrFacebookAccount)
                    {
                    }

                    List <FacebookGroup> lstFacebookGroup = GetGroupName(accesstoken);

                    string grpName = string.Empty;
                    foreach (FacebookGroup item in lstFacebookGroup)
                    {
                        try
                        {
                            grpName += "<div><a href=\"" + GetGroupInfo(accesstoken, item.GroupId) + "\">" + item.Name + "</a></div>";
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.StackTrace);
                        }
                    }

                    groupname = grpName;

                    //string

                    //<div class="title">
                    //        PROFILES</div>
                    //</div>
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
            }
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            User user = (User)Session["LoggedUser"];

            try
            {
                #region for You can use only 30 days as Unpaid User

                //SocioBoard.Domain.User user = (User)Session["LoggedUser"];
                if (user.PaymentStatus.ToLower() == "unpaid")
                {
                    if (!SBUtils.IsUserWorkingDaysValid(user.ExpiryDate))
                    {
                        // ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('You can use only 30 days as Unpaid User !');", true);

                        Session["GreaterThan30Days"] = "GreaterThan30Days";

                        Response.Redirect("../Settings/Billing.aspx");
                    }
                }
                #endregion
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error : " + ex.StackTrace);
            }

            if (!IsPostBack)
            {
                if (user == null)
                {
                    Response.Redirect("/Default.aspx");
                }
                try
                {
                    getgrphData(7);
                }
                catch (Exception Err)
                {
                    Console.Write(Err.StackTrace);
                }

                try
                {
                    getNewFriends(7);
                }
                catch (Exception Err)
                {
                    Console.Write(Err.StackTrace);
                }
                try
                {
                    getNewFollowers(7);
                }
                catch (Exception Err)
                {
                    Console.Write(Err.StackTrace);
                }
                try
                {
                    GetFollowersAgeWise(7);
                }
                catch (Exception Err)
                {
                    Console.Write(Err.StackTrace);
                }
                try
                {
                    getFollowFollowersMonth();
                }
                catch (Exception Err)
                {
                    Console.Write(Err.StackTrace);
                }
                try
                {
                    FacebookAccountRepository fbAccRepo  = new FacebookAccountRepository();
                    FacebookFeedRepository    fbFeedRepo = new FacebookFeedRepository();
                    ArrayList arrfbProfile = fbAccRepo.getAllFacebookPagesOfUser(user.Id);
                    long      talking      = 0;
                    foreach (FacebookAccount item in arrfbProfile)
                    {
                        FacebookClient fb = new FacebookClient();
                        fb.AccessToken = item.AccessToken;
                        pagelikes      = pagelikes + fbFeedRepo.countInteractions(item.UserId, item.FbUserId, 7);
                        dynamic talkingabout = fb.Get(item.FbUserId);
                        talking = talking + talkingabout.talking_about_count;
                        // strinteractions = pagelikes.Count(); //(long.Parse(strinteractions) + pagelikes.talking_about_count).ToString();
                    }
                    talkingabtcount = (talking / 100) * arrfbProfile.Count;
                }
                catch (Exception Err)
                {
                    Console.Write(Err.StackTrace);
                }
                try
                {
                    SocialProfilesRepository objsocioRepo = new SocialProfilesRepository();
                    profileCount = objsocioRepo.getAllSocialProfilesOfUser(user.Id).Count();
                }
                catch (Exception Err)
                {
                    Console.Write(Err.StackTrace);
                }

                var strgenderTwt = Session["twtGender"].ToString().Split(',');
                divtwtMale.InnerHtml   = strgenderTwt[0] + "%";
                divtwtfeMale.InnerHtml = strgenderTwt[1] + "%";
            }
        }