protected void Page_Load(object sender, EventArgs e) { RedirectValidator.isUser(); currentUser = (BLL.User)Session["currentUser"]; var circlesname = UserCircleDAO.GetAllUserCircles(currentUser.Id); if (!IsPostBack) { DropDownList1.DataSource = circlesname; DropDownList1.DataTextField = "CircleId"; DropDownList1.DataValueField = "CircleId"; DropDownList1.DataBind(); DropDownList2.DataSource = circlesname; DropDownList2.DataTextField = "CircleId"; DropDownList2.DataValueField = "CircleId"; DropDownList2.DataBind(); } var notfollow = UserDAO.GetNewUser(currentUser.Id); Repeater1.DataSource = notfollow; Repeater1.DataBind(); this.Title = "Home"; //CircleDAO.AddCircle("gym"); refreshGv(); }
protected void Page_Load(object sender, EventArgs e) { RedirectValidator.isUser(); currentUser = (BLL.User)Session["currentUser"]; var notfollow = UserDAO.GetNewUser(currentUser.Id); GridViewFollow.DataSource = notfollow; GridViewFollow.DataBind(); GMap.ApiKey = ConfigurationManager.AppSettings["MapKey"]; if (currentUser.Latitude != null || currentUser.Longitude != null) { LatLng currentPos = new LatLng(); double currentLat = (this.currentUser.Latitude.HasValue) ? this.currentUser.Latitude.Value : 0; double currentLng = (this.currentUser.Longitude.HasValue) ? this.currentUser.Longitude.Value : 0; currentPos.Latitude = currentLat; currentPos.Longitude = currentLng; if (!Page.IsPostBack) { GMap.Center = currentPos; } var marker = new Marker(currentPos); GMap.Overlays.Add(marker); } }
protected void Page_Load(object sender, EventArgs e) { RedirectValidator.isUser(); currentUser = (BLL.User)Session["currentUser"]; bioTB.Text = currentUser.Bio; nameTB.Text = currentUser.Name; }
//TODO: Enable follow user through web api //TODO: Delete conversations protected void Page_Load(object sender, EventArgs e) { RedirectValidator.isUser(); chatRoomId = Convert.ToInt32(Request.QueryString["chatroom"]); currentUser = (BLL.User)Session["currentUser"]; rptUserChatRooms.DataSource = ChatRoomDAO.GetUserChatRooms(currentUser.Id); recieverUser = UserDAO.GetUserById(ChatRoomDAO.GetRecieverId(currentUser.Id, chatRoomId)); if (chatRoomId.Equals(0) || recieverUser == null) { Response.Redirect("/Profile/User.aspx?username=" + currentUser.Username); } else { rptUserChatRooms.DataBind(); requestedUserProfilePicture.ImageUrl = recieverUser.ProfileImage; } }
protected void Page_Load(object sender, EventArgs e) { RedirectValidator.isUser(); currentUser = (BLL.User)Session["currentUser"]; foreach (BLL.Post post in PostDAO.GetPosts()) { postDataList.InnerHtml += "<option value='" + post.Content + "'>" + post.Content + "</option>"; } foreach (BLL.Circle circle in CircleDAO.GetAllCircles()) { circleDataList.InnerHtml += "<option value='" + circle.Id + "'>" + circle.Id + "</option>"; } foreach (BLL.User user in UserDAO.GetAllUsers()) { userDataList.InnerHtml += "<option value='" + user.Username + "'>" + user.Username + "</option>"; } }
protected void Page_Load(object sender, EventArgs e) { if (String.IsNullOrEmpty(Request.QueryString["addingCircles"])) { RedirectValidator.isUser(isAddingUserCircles: false); } else { addCirclesCloseButton.Visible = false; RedirectValidator.isUser(isAddingUserCircles: true); } currentUser = (BLL.User)Session["currentUser"]; requestedUser = GetUserByIdentifier(Request.QueryString["username"]); if (requestedUser == null) { requestedUser = currentUser; } Event retrieveEventData = new Event(); List <Event> createdEventDataList = new List <Event>(); if (!Page.IsPostBack) { existingUserCircleList = UserCircleDAO.GetAllUserCircles(requestedUser.Id); foreach (UserCircle userCircle in existingUserCircleList) { var userDetailsForCircle = UserCircleDAO.GetCircleFollowerDetails(userCircle.CircleId); circleFollowerDetailList.Add(userDetailsForCircle); } rptUpdateCircles.DataSource = existingUserCircleList; rptUpdateCircles.DataBind(); rptUserCircles.DataSource = existingUserCircleList; rptUserCircles.DataBind(); rptCircleFollowerLinks.DataSource = existingUserCircleList; rptCircleFollowerLinks.DataBind(); rptUserFollowing.DataSource = FollowDAO.GetAllFollowingUsers(requestedUser.Id); rptUserFollowing.DataBind(); createdEventDataList = retrieveEventData.GetAllEventCreatedByUser(currentUser.Id); rpViewEventPageCreated.DataSource = createdEventDataList; rpViewEventPageCreated.DataBind(); bindExisitingCircles(); updateCirclesModal(); initializeNearbyUserMap(); } GMap.OverlayClick += new EventHandler <OverlayEventArgs>(MarkerClick); Title = requestedUser.Username + " - MyCircles"; ProfilePicImage.ImageUrl = requestedUser.ProfileImage; lbName.Text = requestedUser.Name; lbUsername.Text = "@" + requestedUser.Username; lbBio.InnerText = requestedUser.Bio; lbCity.InnerText = requestedUser.City; if (requestedUser.Id == currentUser.Id) { btMessage.Visible = false; } else { var sCoord = new GeoCoordinate(Double.Parse(currentUser.Latitude.ToString()), Double.Parse(currentUser.Longitude.ToString())); var eCoord = new GeoCoordinate(Double.Parse(requestedUser.Latitude.ToString()), Double.Parse(requestedUser.Longitude.ToString())); lbDistance.InnerText = (sCoord.GetDistanceTo(eCoord) / 1000).ToString("0.0") + " km away"; btEditProfile.Visible = false; btMessage.Visible = true; followWarning.InnerText = requestedUser.Name + " has not followed anyone yet"; } if (String.IsNullOrEmpty(requestedUser.Bio)) { lbBio.Visible = false; } else { lbBio.Visible = true; } if (rptUserFollowing.Items.Count > 0) { followWarning.Visible = false; } else { followWarning.Visible = true; } }