Example #1
0
 protected void ShowFollowing()
 {
     FollowsData follows = new FollowsData(MapPath("."));
     UsersData users = new UsersData(MapPath("."));
     string fontID = (string)Request.QueryString["id"];
     if (follows.IsFollow((string)Session["userID"], "font", fontID))
     {
         Button_Follow.Enabled = false;
         Button_Unfollow.Enabled = true;
     }
     else
     {
         Button_Follow.Enabled = true;
         Button_Unfollow.Enabled = false;
     }
     var followers = follows.FindObjectIDs("font", fontID);
     foreach (var follower in followers)
     {
         Label_Followers.Text += "<div class=\"follows\">" +
             string.Format("<a href=\"user.aspx?id={0}\">{1}</a>", follower["userID"], users.FindUserID(follower["userID"])["userName"]) +
             "</div>";
     }
 }
Example #2
0
 protected void ShowFollowingStatus()
 {
     FollowsData follows = new FollowsData(MapPath("."));
     if ((string)Session["userID"] == (string)Request.QueryString["id"])
     {
         Button_Follow.Visible = false;
         Button_Unfollow.Visible = false;
         return;
     }
     if (follows.IsFollow((string)Session["userID"], "user", (string)Request.QueryString["id"]))
     {
         Button_Follow.Enabled = false;
         Button_Unfollow.Enabled = true;
     }
     else
     {
         Button_Follow.Enabled = true;
         Button_Unfollow.Enabled = false;
     }
 }