private void btnAddFriend_Click(object sender, EventArgs e) { var index = FriendsGridView.CurrentCell.RowIndex; var selectedRow = FriendsGridView.Rows[index]; var a = Convert.ToInt64(selectedRow.Cells["ID"].Value); var friendsLink = new WCFService.FriendTable { idOne = a, idTwo = _dataStorage.UserId }; _service.CreateFriendsLink(a, _dataStorage.UserId); btnSeeFriends_Click(sender, e); }
private void RemoveBtn_Click(object sender, EventArgs e) { var index = FriendsGridView.CurrentCell.RowIndex; var selectedRow = FriendsGridView.Rows[index]; var a = Convert.ToInt64(selectedRow.Cells["ID"].Value); if (!selectedRow.Cells["isFriend"].Value.Equals("true")) { return; } var friendsLink = new WCFService.FriendTable { idTwo = a, idOne = _dataStorage.UserId }; _service.RemoveFriend(_dataStorage.UserId, a); selectedRow.Cells["isFriend"].Value = "Not your friend anymore"; btnSeeFriends_Click(sender, e); // RemoveBtn_Click(sender, e); }