protected void Page_Load(object sender, EventArgs e) { if (!(HttpContext.Current.User.Identity.IsAuthenticated)) { FormsAuthentication.SignOut(); Session.Clear(); Response.Redirect("~/Default"); } currentlyLoggedUserName = HttpContext.Current.User.Identity.Name; currentlyLoggedUserID = Membership.GetUser(currentlyLoggedUserName).ProviderUserKey.ToString(); if (currentlyLoggedUserID == null) { Response.Redirect("~/Default"); } studentList = new List <student22>(); if (!IsPostBack) { seachAllUSers.Visible = false; } userFoundLabel.Visible = false; usernameInSearchBox = searchBox.Text; friendHld = new friendHandler(); //check to see if they are friends or not createTable(); }//end of searchUsers class
protected void Page_Load(object sender, EventArgs e) { if (!(HttpContext.Current.User.Identity.IsAuthenticated)) { FormsAuthentication.SignOut(); Session.Clear(); Response.Redirect("~/Default"); } currentlyLoggedUserName = HttpContext.Current.User.Identity.Name; currentlyLoggedUserID = Membership.GetUser(currentlyLoggedUserName).ProviderUserKey.ToString(); if (currentlyLoggedUserID == null) { Response.Redirect("~/Default"); } ListOFFreinds = new List <student22>(); this.friendIDList = new List <String>(); friendHld = new friendHandler(); //visitedUserId if (Session["id"] != null) { currentlyLoggedUserID = Session["id"].ToString(); } //visitedUserId if the mutual frienfs button is clicked if (Session["mutualClick"] != null) { visitedUserId = Session["mutualClick"].ToString(); friendIDList = friendHld.mutualFriends(currentlyLoggedUserID, visitedUserId); } else { friendIDList = friendHld.getFriendsList(currentlyLoggedUserID); } foreach (String friendID in friendIDList) { student22 myFriend = new student22(friendID, 0); ListOFFreinds.Add(myFriend); } createTable(); }
protected void Page_Load(object sender, EventArgs e) { if (!(HttpContext.Current.User.Identity.IsAuthenticated)) { FormsAuthentication.SignOut(); Session.Clear(); Response.Redirect("~/Default"); } currentlyLoggedUserName = HttpContext.Current.User.Identity.Name; currentlyLoggedUserID = Membership.GetUser(currentlyLoggedUserName).ProviderUserKey.ToString(); if (currentlyLoggedUserID == null) { Response.Redirect("~/Default"); } ListOFFreinds = new List<student22>(); this.friendIDList = new List<String>(); friendHld = new friendHandler(); //visitedUserId if (Session["id"] != null) { currentlyLoggedUserID = Session["id"].ToString(); } //visitedUserId if the mutual frienfs button is clicked if (Session["mutualClick"] != null) { visitedUserId = Session["mutualClick"].ToString(); friendIDList = friendHld.mutualFriends(currentlyLoggedUserID, visitedUserId); } else friendIDList = friendHld.getFriendsList(currentlyLoggedUserID); foreach (String friendID in friendIDList) { student22 myFriend = new student22(friendID, 0); ListOFFreinds.Add(myFriend); } createTable(); }
protected void Page_Load(object sender, EventArgs e) { if (!(HttpContext.Current.User.Identity.IsAuthenticated)) { FormsAuthentication.SignOut(); Session.Clear(); Response.Redirect("~/Default"); } //getting information about currently logged in user currentlyLoggedUserName = HttpContext.Current.User.Identity.Name; currentlyLoggedUserID = Membership.GetUser(currentlyLoggedUserName).ProviderUserKey.ToString(); if (currentlyLoggedUserID == null) { Response.Redirect("~/Default"); } //recieve a username from another page (from visitedUserName = ""; if (Session["name"] != null) { visitedUserName = Session["name"].ToString(); visitedStudent = new student22(visitedUserName); visitedUserId = visitedStudent.getStudent_id(); } else Response.Redirect("~/Default"); friendHld = new friendHandler(); if (currentlyLoggedUserName.Equals(visitedUserName)) { btnFriends.Text = "Your friends"; btnMutalFriends.Visible = false; btnAddFriend.Visible = false; } else { btnFriends.Text = visitedUserName + "'s friends"; numOfMutualFriends = friendHld.getNumberOfMutualFriends(currentlyLoggedUserID, visitedUserId); btnMutalFriends.Text = "" + numOfMutualFriends + " Mutual friends"; //check to see if they are friends or not //btnAddFriend.Text = "Unfriend" if they are; areTheyFriends(); } //for debugging System.Diagnostics.Debug.WriteLine("userName is = " + visitedUserName); Image1.ImageUrl = "ImageHandler.ashx?UserId=" + visitedUserId; //get information about the currently logged in student studentName = visitedStudent.getActualName(); majorName = visitedStudent.getMajor(); AboutYourselve = visitedStudent.getAboutMe(); //set labels in front end studentNameLabel.Text = studentName; usernameLabel.Text = visitedUserName; majorNameLabel.Text = majorName; //summaryLabelBox.Text = AboutYourselve; summaryLabel.Text = AboutYourselve; //make the h3 tag change dynamically when the page is loaded to reflect change in username messageh3.InnerText = "Send a message to: " + visitedUserName; //dynamically change the width if /* int charRows = 0; string tbCOntent; int chars = 0; tbCOntent = AboutYourselve; summaryLabelBox.Columns = 60; chars = tbCOntent.Length; charRows = chars / summaryLabelBox.Columns; int remaining = chars - charRows * summaryLabelBox.Columns; if (remaining == 0) { summaryLabelBox.Rows = charRows; summaryLabelBox.TextMode = TextBoxMode.MultiLine; } else { summaryLabelBox.Rows = charRows + 1; summaryLabelBox.TextMode = TextBoxMode.MultiLine; } */ }
protected void Page_Load(object sender, EventArgs e) { if (!(HttpContext.Current.User.Identity.IsAuthenticated)) { FormsAuthentication.SignOut(); Session.Clear(); Response.Redirect("~/Default"); } currentlyLoggedUserName = HttpContext.Current.User.Identity.Name; currentlyLoggedUserID = Membership.GetUser(currentlyLoggedUserName).ProviderUserKey.ToString(); if (currentlyLoggedUserID == null) { Response.Redirect("~/Default"); } studentList = new List<student22>(); if (!IsPostBack) seachAllUSers.Visible = false; userFoundLabel.Visible = false; usernameInSearchBox = searchBox.Text; friendHld = new friendHandler(); //check to see if they are friends or not createTable(); }
protected void Page_Load(object sender, EventArgs e) { if (!(HttpContext.Current.User.Identity.IsAuthenticated)) { FormsAuthentication.SignOut(); Session.Clear(); Response.Redirect("~/Default"); } //getting information about currently logged in user currentlyLoggedUserName = HttpContext.Current.User.Identity.Name; currentlyLoggedUserID = Membership.GetUser(currentlyLoggedUserName).ProviderUserKey.ToString(); if (currentlyLoggedUserID == null) { Response.Redirect("~/Default"); } //recieve a username from another page (from visitedUserName = ""; if (Session["name"] != null) { visitedUserName = Session["name"].ToString(); visitedStudent = new student22(visitedUserName); visitedUserId = visitedStudent.getStudent_id(); } else { Response.Redirect("~/Default"); } friendHld = new friendHandler(); if (currentlyLoggedUserName.Equals(visitedUserName)) { btnFriends.Text = "Your friends"; btnMutalFriends.Visible = false; btnAddFriend.Visible = false; } else { btnFriends.Text = visitedUserName + "'s friends"; numOfMutualFriends = friendHld.getNumberOfMutualFriends(currentlyLoggedUserID, visitedUserId); btnMutalFriends.Text = "" + numOfMutualFriends + " Mutual friends"; //check to see if they are friends or not //btnAddFriend.Text = "Unfriend" if they are; areTheyFriends(); } //for debugging System.Diagnostics.Debug.WriteLine("userName is = " + visitedUserName); Image1.ImageUrl = "ImageHandler.ashx?UserId=" + visitedUserId; //get information about the currently logged in student studentName = visitedStudent.getActualName(); majorName = visitedStudent.getMajor(); AboutYourselve = visitedStudent.getAboutMe(); //set labels in front end studentNameLabel.Text = studentName; usernameLabel.Text = visitedUserName; majorNameLabel.Text = majorName; //summaryLabelBox.Text = AboutYourselve; summaryLabel.Text = AboutYourselve; //make the h3 tag change dynamically when the page is loaded to reflect change in username messageh3.InnerText = "Send a message to: " + visitedUserName; //dynamically change the width if /* * int charRows = 0; * string tbCOntent; * int chars = 0; * tbCOntent = AboutYourselve; * summaryLabelBox.Columns = 60; * chars = tbCOntent.Length; * charRows = chars / summaryLabelBox.Columns; * int remaining = chars - charRows * summaryLabelBox.Columns; * if (remaining == 0) * { * summaryLabelBox.Rows = charRows; * summaryLabelBox.TextMode = TextBoxMode.MultiLine; * } * else * { * summaryLabelBox.Rows = charRows + 1; * summaryLabelBox.TextMode = TextBoxMode.MultiLine; * } */ }