private void btnModificar1_Click(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count > 0) { DetallesClienteIU detalle = new DetallesClienteIU(); detalle.StartPosition = FormStartPosition.CenterParent; detalle.operacion = (byte)MisConstantes.OPERACION.Modificacion; detalle.txtID.Text = dataGridView1.CurrentRow.Cells["IDCliente"].Value.ToString(); detalle.txtNombres.Text = dataGridView1.CurrentRow.Cells["Nombres"].Value.ToString(); detalle.txtApellidos.Text = dataGridView1.CurrentRow.Cells["Apellidos"].Value.ToString(); detalle.txtDNI.Text = dataGridView1.CurrentRow.Cells["DNI"].Value.ToString(); detalle.txtEdad.Text = dataGridView1.CurrentRow.Cells["Edad"].Value.ToString(); detalle.boxSexo.Text = dataGridView1.CurrentRow.Cells["Sexo"].Value.ToString(); detalle.chkEstado.Checked = checkBox1.Checked; DialogResult rpta = detalle.ShowDialog(); if (rpta == DialogResult.OK) { mostrar_datos(); } } }
private void btnInsertar_Click(object sender, EventArgs e) { DetallesClienteIU detalle = new DetallesClienteIU(); detalle.StartPosition = FormStartPosition.CenterScreen; detalle.operacion = (byte)MisConstantes.OPERACION.Insercion; DialogResult rpta = detalle.ShowDialog(); if (rpta == DialogResult.OK) { mostrar_datos(); } }