private void btnActivate_Click(object sender, EventArgs e) { BLAdmin bl = new BLAdmin(); if (gridAccounts.SelectedRows[0] != null) { DataGridViewRow row = gridAccounts.SelectedRows[0]; bl.SetUserActive(Convert.ToInt32(row.Cells["UserId"].Value)); MessageBox.Show("Contul a fost activat cu succes!", "Succes", MessageBoxButtons.OK); DataTable accountsTable = bl.GetInactiveExternals(); gridAccounts.DataSource = accountsTable; } else { MessageBox.Show("Alegeti utilizatorul pe care doriti sa il activati!", "Atentie", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }