private void btnExcluirEmprestimo_Click(object sender, EventArgs e) { _emprestimo = listEmprestimo.SelectedItem as Emprestimo; if (_emprestimo != null) { var message = MessageBox.Show("Deseja excluir o emprestimo do cliente " + _emprestimo.Cliente + "?", "Atenção", MessageBoxButtons.YesNo); if (message == DialogResult.Yes) { _emprestimoService.DeleteEmprestimo(_emprestimo); ListEmprestimo(); } } else { MessageBox.Show("Selecione um emprestimo para excluir!"); } }