Пример #1
0
        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);
        }