private void BtnDeletar_Click(object sender, EventArgs e) { if (txtID.Text.Trim() == string.Empty) { MessageBox.Show("Selecione Algum Registro"); } else if (txtDataFechamento.Text == "." && txtStatus.Text == "Aberta") { int id = Convert.ToInt32(txtID.Text); ServicoServico ss = new ServicoServico(); /*if (.Count() == 0) * {*/ ss.Remover(id); LimparCampos(); /*} * else * { * MessageBox.Show("Este Animal possui registros vinculados", "Impossível Excluir"); * }*/ } else if (txtDataFechamento.Text != "." && txtStatus.Text != "Aberta") { MessageBox.Show("Não é possível excluir Serviços Finalizados", "Impossível Excluir"); } }