protected void ShowFollows() { FollowsData follows = new FollowsData(MapPath(".")); UsersData users = new UsersData(MapPath(".")); string targetUserID = (string)Request.QueryString["id"]; var hisFollowings = follows.FindUserIDs(targetUserID); foreach (var hisFollowing in hisFollowings) { string followingUserID = hisFollowing["objectID"]; Label_Followings.Text += "<div class=\"follows\">" + string.Format("<a href=\"user.aspx?id={0}\">{1}</a>", followingUserID, users.FindUserID(followingUserID)["userName"]) + "</div>"; } var hisFollowers = follows.FindObjectIDs("user", targetUserID); foreach (var hisFollower in hisFollowers) { string followerUserID = hisFollower["userID"]; Label_Followers.Text += "<div class=\"follows\">" + string.Format("<a href=\"user.aspx?id={0}\">{1}</a>", followerUserID, users.FindUserID(followerUserID)["userName"]) + "</div>"; } }
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>"; } }