コード例 #1
0
 public void UpdateInfo(TwitterUser user)
 {
     UserTweets          = user.StatusesCount;
     TweetCount.Text     = UserTweets.ToString();
     UserFollowing       = user.FriendsCount;
     FollowingCount.Text = UserFollowing.ToString();
     UserFollowers       = user.FollowersCount;
     FollowersCount.Text = UserFollowers.ToString();
 }
コード例 #2
0
 private void SendTweet_Click(object sender, RoutedEventArgs e)
 {
     if ((TweetContentTextBox.Text != "") || (mediaFile != null))
     {
         getTweets.PublishTweet(TweetContentTextBox.Text, mediaFile);
         TweetContentTextBox.Clear();
         ShowNotificationAnimation("Ваш твит отправлен");
         UserTweets++;
         TweetCount.Text  = UserTweets.ToString();
         GreenMark.Source = null;
         mediaFile        = null;
     }
     else
     {
         ShowNotificationAnimation("Введите текст для нового твита");
     }
 }
コード例 #3
0
        private void getTweetCount(string strUserName)
        {
            //SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["ConString"]);
            //SqlCommand cmd = new SqlCommand();
            //string Query = @"usp_getFollowTweets";
            //cmd = new SqlCommand(Query, con);
            //cmd.Parameters.AddWithValue("@UserID", strUserName);
            //DataSet ds = new DataSet();
            //SqlDataAdapter sda = new SqlDataAdapter(Query, con);
            //con.Open();
            //sda.Fill(ds);
            //con.Close();

            int intFollowerTweets  = 0;
            int intFollowingTweets = 0;
            //if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            //{
            //    intFollowerTweets = Convert.ToInt32(ds.Tables[0].Rows[0]["FollowerTweets"].ToString());
            //    intFollowingTweets = Convert.ToInt32(ds.Tables[0].Rows[0]["FollowingTweets"].ToString());
            //}

            testEntities dbTweetsEntity = new testEntities();
            UserTweets   objTweets      = new UserTweets();

            objTweets = dbTweetsEntity.getFollowTweets(strUserName);

            intFollowerTweets  = Convert.ToInt32(objTweets.FollowerTweets.ToString());
            intFollowingTweets = Convert.ToInt32(objTweets.FollowingTweets.ToString());

            var userTweet = new UserTweets()
            {
                fullName        = Session["UserFullName"].ToString(),
                TotalTweets     = intFollowerTweets + intFollowingTweets,
                FollowerTweets  = intFollowerTweets,
                FollowingTweets = intFollowingTweets
            };

            ViewBag.UserTweet = userTweet;
        }