private void btnCreate_Click(object sender, EventArgs e) { ABM_Persona cadete = new ABM_Persona(); cadete.Tipo_persona = 2; cadete.ShowDialog(); mostrarCadetes(); }
private void btnModificar_Click(object sender, EventArgs e) { if (tablaCadetes.Rows.Count != 0 && tablaCadetes.Rows != null) { if (cadeteSeleccionado) { ABM_Persona p = new ABM_Persona(); p.Tipo_persona = 2; p.Modificar = true; p.Id_persona = tablaCadetes.CurrentRow.Cells[0].Value.ToString(); p.Apellido = tablaCadetes.CurrentRow.Cells[1].Value.ToString(); p.Nombre = tablaCadetes.CurrentRow.Cells[2].Value.ToString(); p.Direccion = tablaCadetes.CurrentRow.Cells[3].Value.ToString(); p.Telefono = tablaCadetes.CurrentRow.Cells[4].Value.ToString(); p.Celular = tablaCadetes.CurrentRow.Cells[5].Value.ToString(); p.Patente = tablaCadetes.CurrentRow.Cells[6].Value.ToString(); p.ShowDialog(); mostrarCadetes(); cadeteSeleccionado = false; } } }