예제 #1
0
 /// <summary>
 /// Event Handler of the button Update.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     if (!(lbPersonas.SelectedItem is null))
     {
         person.Nombre   = txtNombre.Text;
         person.Apellido = txtApellido.Text;
         PersonaDAO.Modificar(person);
         UpdateListBox();
     }
 }
예제 #2
0
        private void btnModificar_Click(object sender, EventArgs e)
        {
            string nombre;
            string apellido;
            int    id;

            PersonaDAO personaDAO = new PersonaDAO();

            nombre   = txtNombre.Text;
            apellido = txtApellido.Text;
            id       = ((Persona)lstPersonas.SelectedItem).Id;

            personaDAO.Modificar(id, nombre, apellido);
        }
예제 #3
0
 private void btn_Modificar_Click(object sender, EventArgs e)
 {
     try
     {
         Persona auxP = (Persona)datagrid_Personas.CurrentRow.DataBoundItem;
         if (PersonaDAO.Modificar(auxP))
         {
             MessageBox.Show("Se Modificaron los datos correctamente", "Modificacion Exitosa", MessageBoxButtons.OK);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
예제 #4
0
 private void btnModificar_Click(object sender, EventArgs e)
 {
     try
     {
         int index = ltsPersonas.SelectedIndex;
         if (index >= 0)
         {
             Persona p = personas[index];
             if (PersonaDAO.Modificar(p.Identificacion, txtNombre.Text, txtApellido.Text))
             {
                 MessageBox.Show("Modificado correctamente!!");
                 btnLeer_Click(sender, e);
             }
         }
         else
         {
             MessageBox.Show("Debe seleccionar a alguien de la lista.");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("ERROR: " + ex.ToString());
     }
 }
예제 #5
0
 private void btnModificar_Click(object sender, EventArgs e)
 {
     personaDAO.Modificar(int.Parse(txtID.Text), txtNombre.Text, txtApellido.Text);
 }