Exemplo n.º 1
0
 private void BtnDeletar_Click(object sender, EventArgs e)
 {
     if (txtID.Text.Trim() == string.Empty)
     {
         MessageBox.Show("Selecione Algum Registro");
     }
     else
     {
         int id = Convert.ToInt32(txtID.Text);
         ProntuarioServico ps = new ProntuarioServico();
         if (ps.ProntuariosPorAnimal(id).Count() == 0)
         {
             ans.Remover(id);
             LimparCampos();
         }
         else
         {
             MessageBox.Show("Este Animal possui registros vinculados", "Impossível Excluir");
         }
     }
 }