/// <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(); } }
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); }
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); } }
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()); } }
private void btnModificar_Click(object sender, EventArgs e) { personaDAO.Modificar(int.Parse(txtID.Text), txtNombre.Text, txtApellido.Text); }