コード例 #1
0
        private void GetMessage()
        {
            var _clsGetMessage = new BllTweet();

            if (Session["login"] != null && Session["UserName"] != null && Session["AccountID"] != null)
            {
                var _dtGetMessage      = _clsGetMessage.GetTweetMessage(int.Parse(Session["AccountID"].ToString()));
                var _dtGetCountMessage = _clsGetMessage.GetTweetCountMessage(int.Parse(Session["AccountID"].ToString()));
                if (_dtGetMessage != null && _dtGetMessage.Rows.Count > 0 &&
                    _dtGetCountMessage != null && _dtGetCountMessage.Rows.Count > 0)
                {
                    if (int.Parse(_dtGetCountMessage.Rows[0]["CountMessage"].ToString()) > 0)
                    {
                        _CountMessage = "( " + _dtGetCountMessage.Rows[0]["CountMessage"] + " )";
                    }
                    ListViewAll.DataSource = _dtGetMessage;
                    ListViewAll.DataBind();
                    ListViewAll.Visible       = true;
                    btnViewMessageAll.Visible = true;
                    drmsg.Visible             = true;
                }
                else
                {
                    ListViewAll.Visible       = false;
                    btnViewMessageAll.Visible = false;
                    drmsg.Visible             = false;
                }
            }
        }
コード例 #2
0
        private void GetNews(int pageSize)
        {
            var _clsGetNews     = new BllGetNews();
            var _dtGetNewsCount = _clsGetNews.GetNewsCount();
            var _dtGetNews      = _clsGetNews.GetNews(string.Empty, pageSize);

            if (_dtGetNews != null && _dtGetNews.Rows.Count > 0)
            {
                ListViewAll.DataSource = _dtGetNews;
                ListViewAll.DataBind();
                ListViewAll.Visible = true;
                lbTotal.Text        = _dtGetNews.Rows.Count.ToString();
                if (_dtGetNewsCount != null && _dtGetNewsCount.Rows.Count > 0)
                {
                    if (int.Parse(lbTotal.Text) == int.Parse(_dtGetNewsCount.Rows[0]["Total"].ToString()))
                    {
                        btnViewMore.Visible = false;
                    }
                    else
                    {
                        btnViewMore.Visible = true;
                    }
                }
            }
            else
            {
                ListViewAll.Visible = false;
                btnViewMore.Visible = false;
            }
        }
コード例 #3
0
 private void GetUserTopFollower()
 {
     if (Session["login"] == null && Session["UserName"] == null && Session["AccountID"] == null)
     {
         var _clsGetUserTopFollower = new BllFollower();
         var _dtGetUserTopFollower  = _clsGetUserTopFollower.GetTopUserFollower();
         if (_dtGetUserTopFollower != null && _dtGetUserTopFollower.Rows.Count > 0)
         {
             ListViewAll.DataSource = _dtGetUserTopFollower;
             ListViewAll.DataBind();
             ListViewAll.Visible = true;
         }
         else
         {
             ListViewAll.Visible = false;
         }
     }
     else
     {
         var _clsGetUserTopFollower = new BllFollower();
         var _dtGetUserTopFollower  = _clsGetUserTopFollower.GetTopUserFollowerWithLogin(int.Parse(Session["AccountID"].ToString()));
         if (_dtGetUserTopFollower != null && _dtGetUserTopFollower.Rows.Count > 0)
         {
             ListViewAll.DataSource = _dtGetUserTopFollower;
             ListViewAll.DataBind();
             ListViewAll.Visible = true;
         }
         else
         {
             ListViewAll.Visible = false;
         }
     }
 }
        private void GetWall(string UserName, int pageSize)
        {
            var _clsGetWall     = new BllWall();
            var _dtGetWallCount = _clsGetWall.GetWallCount(UserName);
            var _dtGetWall      = _clsGetWall.GetWall(UserName, pageSize);

            if (_dtGetWall != null && _dtGetWall.Rows.Count > 0)
            {
                lbIDUser.Text          = _dtGetWall.Rows[0]["AccountID"].ToString();
                lbUserMain.Text        = _dtGetWall.Rows[0]["AccountID"].ToString();
                ListViewAll.DataSource = _dtGetWall;
                ListViewAll.DataBind();
                ListViewAll.Visible = true;
                lbTotal.Text        = _dtGetWall.Rows.Count.ToString();
                if (_dtGetWallCount != null && _dtGetWallCount.Rows.Count > 0)
                {
                    if (int.Parse(lbTotal.Text) < int.Parse(WebConfigurationManager.AppSettings["pageSizeWall"]))
                    {
                        btnViewMore.Visible = false;
                    }
                    else if (int.Parse(lbTotal.Text) == int.Parse(_dtGetWallCount.Rows[0]["Total"].ToString()))
                    {
                        btnViewMore.Visible = false;
                    }
                    else
                    {
                        btnViewMore.Visible = true;
                    }
                }
            }
            else
            {
                ListViewAll.Visible = false;
                btnViewMore.Visible = false;
            }
        }
コード例 #5
0
 private void GetUserFollower()
 {
     if (Session["login"] == null && Session["UserName"] == null && Session["AccountID"] == null)
     {
         var _clsGetUserFollower = new BllUser();
         if (String.IsNullOrEmpty(txtSearchFriend.Value))
         {
             var _dtGetUserFollower = _clsGetUserFollower.GetUser(string.Empty);
             if (_dtGetUserFollower != null && _dtGetUserFollower.Rows.Count > 0)
             {
                 ListViewAll.DataSource = _dtGetUserFollower;
                 ListViewAll.DataBind();
                 ListViewAll.Visible = true;
             }
             else
             {
                 ListViewAll.Visible = false;
             }
         }
         else
         {
             var _dtGetUserFollower = _clsGetUserFollower.GetUser(txtSearchFriend.Value);
             if (_dtGetUserFollower != null && _dtGetUserFollower.Rows.Count > 0)
             {
                 ListViewAll.DataSource = _dtGetUserFollower;
                 ListViewAll.DataBind();
                 ListViewAll.Visible = true;
             }
             else
             {
                 ListViewAll.Visible = false;
             }
         }
     }
     else
     {
         var _clsGetUserFollower = new BllUser();
         if (String.IsNullOrEmpty(txtSearchFriend.Value))
         {
             var _dtGetUserFollower = _clsGetUserFollower.GetUserFollower(string.Empty,
                                                                          (Session["AccountID"].ToString()));
             if (_dtGetUserFollower != null && _dtGetUserFollower.Rows.Count > 0)
             {
                 ListViewAll.DataSource = _dtGetUserFollower;
                 ListViewAll.DataBind();
                 ListViewAll.Visible = true;
             }
             else
             {
                 ListViewAll.Visible = false;
             }
         }
         else
         {
             var _dtGetUserFollower = _clsGetUserFollower.GetUserFollower(txtSearchFriend.Value,
                                                                          (Session["AccountID"].ToString()));
             if (_dtGetUserFollower != null && _dtGetUserFollower.Rows.Count > 0)
             {
                 ListViewAll.DataSource = _dtGetUserFollower;
                 ListViewAll.DataBind();
                 ListViewAll.Visible = true;
             }
             else
             {
                 ListViewAll.Visible = false;
             }
         }
     }
 }