Exemple #1
0
        public void getNewFriends(int days)
        {
            try
            {
                SocioBoard.Domain.User user = (User)Session["LoggedUser"];
                FacebookStatsRepository objfbStatsRepo = new FacebookStatsRepository();
                ArrayList arrFbStats = objfbStatsRepo.getAllFacebookStatsOfUser(user.Id, days);

                // Get facebook page like ...
                FacebookAccountRepository ObjAcFbAccount = new FacebookAccountRepository();
                int TotalLikes = ObjAcFbAccount.getPagelikebyUserId(user.Id);

                strFBArray = "[";
                int intdays = 1;
                foreach (var item in arrFbStats)
                {
                    Array temp = (Array)item;
                    strFBArray += (int.Parse(temp.GetValue(3).ToString()) + int.Parse(temp.GetValue(4).ToString())) + ",";
                    //spanFbFans.InnerHtml = (int.Parse(temp.GetValue(3).ToString()) + int.Parse(temp.GetValue(4).ToString())).ToString();
                    spanFbFans.InnerHtml = (TotalLikes).ToString();
                    intdays++;
                }
                if (intdays < 7)
                {
                    for (int i = 0; i < 7 - arrFbStats.Count; i++)
                    {
                        strFBArray = strFBArray + "0,";
                    }
                }
                strFBArray = strFBArray.Substring(0, strFBArray.Length - 1);
                strFBArray += "]";
            }
            catch (Exception Err)
            {
                Console.Write(Err.Message.ToString());
                logger.Error(Err.StackTrace);
            }
        }