protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Session["user_id"] == "") { Response.Redirect("Login.aspx"); } string user = Request.QueryString["user"]; ImageButton masterProfilePic = (ImageButton)Master.FindControl("ProfilePic"); masterProfilePic.Visible = true; profilecoverpic = profilecoverpicHandler.ProfileCoverPic_Details((string)Session["user_id"]); if (profilecoverpic.ProfilePic == true) { masterProfilePic.ImageUrl = "~/ProfilePic/" + (string)Session["user_id"] + ".jpg"; } else { masterProfilePic.ImageUrl = "~/ProfilePic/default.png"; } HyperLink h1 = (HyperLink)Master.FindControl("TweetsLink"); h1.Text = tweetHandler.Tweet_Count((string)(Session["user_id"])).ToString() + " Tweet(s)"; HyperLink h2 = (HyperLink)Master.FindControl("FollowingLink"); h2.Text = followingHandler.Find_Following_Count((string)(Session["user_id"])).ToString() + " Following(s)"; HyperLink h3 = (HyperLink)Master.FindControl("FollowersLink"); h3.Text = followingHandler.Find_Followers_Count((string)(Session["user_id"])).ToString() + " Follower(s)"; person = personHandler.Person_Details((string)Session["user_id"]); Label l1 = (Label)Master.FindControl("FullName"); l1.Text = person.FullName; Label l2 = (Label)Master.FindControl("UserName"); l2.Text = "(@" + (string)Session["user_id"] + ")"; List <Person> personList = personHandler.Search_Results(user); if (personList != null) { foreach (Person p in personList) { string user_id = p.User_id; string fullName = p.FullName; bool profilepic = p.ProfilePic; string user_idShow = p.User_idShow; string profilepicurl = p.ProfilepicUrl; SearchResults.DataSource = personList; SearchResults.DataBind(); } } else { noUserFoundLabel.Text = "No such User found."; } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Session["user_id"] == "") { Response.Redirect("Login.aspx"); } ImageButton masterProfilePic = (ImageButton)Master.FindControl("ProfilePic"); masterProfilePic.Visible = true; profilecoverpic = profilecoverpicHandler.ProfileCoverPic_Details((string)Session["user_id"]); if (profilecoverpic.ProfilePic == true) { masterProfilePic.ImageUrl = "~/ProfilePic/" + (string)Session["user_id"] + ".jpg"; } else { masterProfilePic.ImageUrl = "~/ProfilePic/default.png"; } HyperLink h1 = (HyperLink)Master.FindControl("TweetsLink"); h1.Text = tweetHandler.Tweet_Count((string)(Session["user_id"])).ToString() + " Tweet(s)"; HyperLink h2 = (HyperLink)Master.FindControl("FollowingLink"); h2.Text = followingHandler.Find_Following_Count((string)(Session["user_id"])).ToString() + " Following(s)"; HyperLink h3 = (HyperLink)Master.FindControl("FollowersLink"); h3.Text = followingHandler.Find_Followers_Count((string)(Session["user_id"])).ToString() + " Follower(s)"; person = personHandler.Person_Details((string)Session["user_id"]); Label l1 = (Label)Master.FindControl("FullName"); l1.Text = person.FullName; Label l2 = (Label)Master.FindControl("UserName"); l2.Text = "(@" + (string)Session["user_id"] + ")"; List <Tweet> tweetList = tweetHandler.Tweet_List_Following((string)Session["user_id"]); if (tweetList != null) { foreach (Tweet t in tweetList) { int tweet_id = t.Tweet_id; string user_id = t.User_id; string fullName = t.FullName; string message = t.Message; bool profilepic = t.ProfilePic; string user_idShow = t.User_idShow; string profilepicurl = t.ProfilepicUrl; TweetDataList.DataSource = tweetList; TweetDataList.DataBind(); } } else { noTweetLabel.Text = "No tweets to show."; } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Session["user_id"] == "") { Response.Redirect("Login.aspx"); } ImageButton masterProfilePic = (ImageButton)Master.FindControl("ProfilePic"); masterProfilePic.Visible = true; profilecoverpic = profilecoverpicHandler.ProfileCoverPic_Details((string)Session["user_id"]); if (profilecoverpic.ProfilePic == true) { masterProfilePic.ImageUrl = "~/ProfilePic/" + (string)Session["user_id"] + ".jpg"; } else { masterProfilePic.ImageUrl = "~/ProfilePic/default.png"; } HyperLink h1 = (HyperLink)Master.FindControl("TweetsLink"); h1.Text = tweetHandler.Tweet_Count((string)(Session["user_id"])).ToString() + " Tweet(s)"; HyperLink h2 = (HyperLink)Master.FindControl("FollowingLink"); h2.Text = followingHandler.Find_Following_Count((string)(Session["user_id"])).ToString() + " Following(s)"; HyperLink h3 = (HyperLink)Master.FindControl("FollowersLink"); h3.Text = followingHandler.Find_Followers_Count((string)(Session["user_id"])).ToString() + " Follower(s)"; person = personHandler.Person_Details((string)Session["user_id"]); Label l1 = (Label)Master.FindControl("FullName"); l1.Text = person.FullName; Label l2 = (Label)Master.FindControl("UserName"); l2.Text = "(@" + (string)Session["user_id"] + ")"; person = personHandler.Person_Details((string)Session["user_id"]); FullNameLabel.Text = person.FullName; UserNameLabel.Text = (string)Session["user_id"]; EmailLabel.Text = person.Email; JoinedLabel.Text = person.Joined.ToString(); FullNameTextBox.Text = FullNameLabel.Text; EmailTextBox.Text = EmailLabel.Text; } }
public ProfileCoverPic ProfileCoverPic_Details(string user_id) { ProfileCoverPic profilecoverpic = null; SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@user_id", user_id) }; using (DataTable table = SqlDBHelper.ExecuteParamerizedSelectCommand("ProfileCoverPic_Details", CommandType.StoredProcedure, parameters)) { if (table.Rows.Count == 1) { DataRow row = table.Rows[0]; profilecoverpic = new ProfileCoverPic(); profilecoverpic.ProfilePic = (bool)row["profilepic"]; profilecoverpic.CoverPic = (bool)row["coverpic"]; } } return(profilecoverpic); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Session["user_id"] == "") { Response.Redirect("Login.aspx"); } string user_idQuery = Request.QueryString["user_id"]; ImageButton masterProfilePic = (ImageButton)Master.FindControl("ProfilePic"); masterProfilePic.Visible = true; profilecoverpic = profilecoverpicHandler.ProfileCoverPic_Details(user_idQuery); if (profilecoverpic.ProfilePic == true) { masterProfilePic.ImageUrl = "~/ProfilePic/" + user_idQuery + ".jpg"; } else { masterProfilePic.ImageUrl = "~/ProfilePic/default.png"; } HyperLink h1 = (HyperLink)Master.FindControl("TweetsLink"); h1.Text = tweetHandler.Tweet_Count(user_idQuery).ToString() + " Tweet(s)"; h1.NavigateUrl = "OtherProfile.aspx?user_id=" + user_idQuery; HyperLink h2 = (HyperLink)Master.FindControl("FollowingLink"); h2.Text = followingHandler.Find_Following_Count(user_idQuery).ToString() + " Following(s)"; h2.NavigateUrl = "OtherFollowing.aspx?user_id=" + user_idQuery; HyperLink h3 = (HyperLink)Master.FindControl("FollowersLink"); h3.Text = followingHandler.Find_Followers_Count(user_idQuery).ToString() + " Follower(s)"; h3.NavigateUrl = "OtherFollower.aspx?user_id=" + user_idQuery; person = personHandler.Person_Details(user_idQuery); Label l1 = (Label)Master.FindControl("FullName"); l1.Text = person.FullName; Label l2 = (Label)Master.FindControl("UserName"); l2.Text = "(@" + user_idQuery + ")"; List <Following> followingList = followingHandler.Find_Following_Names(user_idQuery); if (followingList != null) { foreach (Following f in followingList) { string user_id = f.User_id; string fullName = f.FullName; bool profilepic = f.ProfilePic; string user_idShow = f.User_idShow; string profilepicurl = f.ProfilepicUrl; FollowingDataList.DataSource = followingList; FollowingDataList.DataBind(); } } else { noFollowingLabel.Text = "You are not Following anybody."; } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Session["user_id"] == "") { Response.Redirect("Login.aspx"); } Master.FindControl("ProfilePic").Visible = false; string user_id = Request.QueryString["user_id"]; if ((string)Session["user_id"] == user_id) { Response.Redirect("Profile.aspx"); } profilecoverpic = profilecoverpicHandler.ProfileCoverPic_Details(user_id); if (profilecoverpic.ProfilePic == true && profilecoverpic.CoverPic == true) { ProfilePicButton.ImageUrl = "~/ProfilePic/" + user_id + ".jpg"; CoverPicButton.ImageUrl = "~/CoverPic/" + user_id + ".jpg"; } else if (profilecoverpic.ProfilePic == true) { ProfilePicButton.ImageUrl = "~/ProfilePic/" + user_id + ".jpg"; } else if (profilecoverpic.CoverPic == true) { CoverPicButton.ImageUrl = "~/CoverPic/" + user_id + ".jpg"; } else { ProfilePicButton.ImageUrl = "~/ProfilePic/default.png"; CoverPicButton.ImageUrl = "~/CoverPic/default.png"; } FollowUnfollowButton.ImageUrl = "~/images/follow-me.jpg"; List <Following> followingList = followingHandler.Find_Following_Names((string)Session["user_id"]); if (followingList != null) { foreach (Following f in followingList) { if (f.User_id == user_id) { FollowUnfollowButton.ImageUrl = "~/images/unfollow-me.jpg"; } } } HyperLink h1 = (HyperLink)Master.FindControl("TweetsLink"); h1.Text = tweetHandler.Tweet_Count(user_id).ToString() + " Tweet(s)"; h1.NavigateUrl = "OtherProfile.aspx?user_id=" + user_id; HyperLink h2 = (HyperLink)Master.FindControl("FollowingLink"); h2.Text = followingHandler.Find_Following_Count(user_id).ToString() + " Following(s)"; h2.NavigateUrl = "OtherFollowing.aspx?user_id=" + user_id; HyperLink h3 = (HyperLink)Master.FindControl("FollowersLink"); h3.Text = followingHandler.Find_Followers_Count(user_id).ToString() + " Follower(s)"; h3.NavigateUrl = "OtherFollower.aspx?user_id=" + user_id; person = personHandler.Person_Details(user_id); FullNameLabel.Text = person.FullName; UserNameLabel.Text = user_id; EmailLabel.Text = person.Email; JoinedLabel.Text = person.Joined.ToString(); List <Tweet> tweetList = tweetHandler.Tweet_List(user_id); if (tweetList != null) { foreach (Tweet t in tweetList) { int tweet_id = t.Tweet_id; string user_idDL = t.User_id; string fullName = t.FullName; string message = t.Message; bool profilepic = t.ProfilePic; string user_idShow = t.User_idShow; string profilepicurl = t.ProfilepicUrl; TweetDataList.DataSource = tweetList; TweetDataList.DataBind(); } } else { noTweetLabel.Text = "No tweets to show."; } } }