Ejemplo n.º 1
0
        private void ExcluirRegistro()
        {
            int id2 = 0;

            try
            {
                if (lstVDependentes.SelectedItems.Count > 0)
                {
                    id2 = Convert.ToInt32(lstVDependentes.SelectedItems[0].Text);

                    Dependente objDependente = new Dependente();

                    if (id2 > 0)
                    {
                        objDependente.Excluir(id2);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro! " + ex);
                // throw;
            }
        }
        private void ExcluirRegistro()
        {
            int id2 = 0;
            try
            {
                if (lstVDependentes.SelectedItems.Count > 0)
                {
                    id2 = Convert.ToInt32(lstVDependentes.SelectedItems[0].Text);

                    Dependente objDependente = new Dependente();

                    if (id2 > 0)
                    {
                        objDependente.Excluir(id2);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro! " + ex);
               // throw;
            }
        }