Exemplo n.º 1
0
        private void btn_Eliminar_Click(object sender, EventArgs e)
        {
            Persona auxP = (Persona)datagrid_Personas.CurrentRow.DataBoundItem;

            if (PersonaDAO.Borrar(auxP))
            {
                MessageBox.Show("Se eliminó los datos correctamente", "Eliminacion Exitosa", MessageBoxButtons.OK);
            }
        }
Exemplo n.º 2
0
        private void btnEliminar_Click(object sender, EventArgs e)
        {
            int id;

            PersonaDAO personaDAO;

            personaDAO = new PersonaDAO();

            id = ((Persona)lstPersonas.SelectedItem).Id;

            personaDAO.Borrar(id);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Event Handler of the button Delete.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnDelete_Click(object sender, EventArgs e)
        {
            int id = 0;

            string[] items;
            if (!(lbPersonas.SelectedItem is null))
            {
                items = lbPersonas.SelectedItem.ToString().Split(' ');
                id    = Convert.ToInt32(items[0]);
                PersonaDAO.Borrar(id);
                UpdateListBox();
            }
        }
Exemplo n.º 4
0
 private void btnEliminar_Click(object sender, EventArgs e)
 {
     try
     {
         int index = ltsPersonas.SelectedIndex;
         if (index >= 0)
         {
             Persona p = personas[index];
             if (PersonaDAO.Borrar(p.Identificacion))
             {
                 MessageBox.Show("Eliminado correctamente!!");
                 btnLeer_Click(sender, e);
             }
         }
         else
         {
             MessageBox.Show("Debe seleccionar a alguien de la lista.");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("ERROR: " + ex.ToString());
     }
 }
Exemplo n.º 5
0
 private void btnEliminar_Click(object sender, EventArgs e)
 {
     p1 = (Persona)listBox1.SelectedItem;
     dao.Borrar(p1.Id);
 }
Exemplo n.º 6
0
 private void btnEliminar_Click(object sender, EventArgs e)
 {
     personaDAO.Borrar(int.Parse(txtID.Text));
 }