private void btnRemovePersonalReference_Click(object sender, EventArgs e) { DialogResult _dr = new DialogResult(); MessageBoxUI _mb = new MessageBoxUI("Are sure you want to continue removing this record?", GlobalVariables.Icons.QuestionMark, GlobalVariables.Buttons.YesNo); _mb.ShowDialog(); _dr = _mb.Operation; if (_dr == DialogResult.Yes) { try { if (loClientPersonalReference.remove(dgvPersonalReference.CurrentRow.Cells[0].Value.ToString())) { MessageBoxUI _mb1 = new MessageBoxUI("Personal Reference has been successfully removed!", GlobalVariables.Icons.Information, GlobalVariables.Buttons.OK); _mb1.ShowDialog(); dgvPersonalReference.DataSource = loClientPersonalReference.getAllData(txtClientId.Text, ""); } } catch (Exception ex) { MessageBoxUI mb = new MessageBoxUI(ex, GlobalVariables.Icons.Error, GlobalVariables.Buttons.OK); mb.ShowDialog(); return; } } }