protected void GridViewFriendsListRequest_RowCommand(object sender, GridViewCommandEventArgs e) { FriendsBO objClass = new FriendsBO(); GridViewRow row = GridViewFriendsListRequest.Rows[Convert.ToInt32(e.CommandArgument)]; objClass.Id = GridViewFriendsListRequest.DataKeys[row.RowIndex].Value.ToString(); if (e.CommandName == "notnow") { objClass.Status = Global.NOTNOW; Response.Write(objClass.FriendUserId); FriendsBLL.delayRequest(objClass); LoadFriendRequests(); } else if (e.CommandName == "confirmnow") { objClass.Status = Global.CONFIRMED; string sValue = ((HiddenField)row.FindControl("HiddenField1")).Value; objClass.FriendUserId = sValue; UserBO objUser = new UserBO(); objUser = UserBLL.getUserByUserId(sValue); FriendsBLL.confirmRequest(objClass); WallPost(" accept friend request of <a href=\"ViewProfile.aspx?UserId=" + Userid + "\">" + objUser.FirstName + " " + objUser.LastName + "</a> "); LoadFriendRequests(); } }
protected void GridViewSuggestions_RowCommand(object sender, GridViewCommandEventArgs e) { FriendsBO objClass = new FriendsBO(); GridViewRow row = GridViewFriendsListRequest.Rows[Convert.ToInt32(e.CommandArgument)]; objClass.Id = GridViewFriendsListRequest.DataKeys[row.RowIndex].Value.ToString(); if (e.CommandName == "notnow") { objClass.Status = Global.NOTNOW; Response.Write(objClass.FriendUserId); FriendsBLL.delayRequest(objClass); LoadFriendRequests(); } else if (e.CommandName == "confirmnow") { objClass.Status = Global.CONFIRMED; string sValue = ((HiddenField)row.FindControl("HiddenField1")).Value; objClass.FriendUserId = sValue; FriendsBLL.confirmRequest(objClass); LoadFriendRequests(); } }