private void BtnDeletar_Click(object sender, EventArgs e) { int id = Convert.ToInt32(txtID.Text); if (txtID.Text.Trim() == string.Empty) { MessageBox.Show("Selecione Algum Registro"); } else { AnimalServico ans = new AnimalServico(); if (ans.AnimaisPorTipo(id).Count() == 0) { tas.Remover(id); LimparCampos(); } else { MessageBox.Show("Este Tipo de Animal possui registros vinculados", "Impossível Excluir"); } } }