private void btnModifica_Click(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count > 0) { DetalleChofer detalle = new DetalleChofer(); detalle.StartPosition = FormStartPosition.CenterParent; detalle.operacion = (byte)MisConstantes.OPERACION.Modificacion; detalle.txtID.Text = dataGridView1.CurrentRow.Cells["ID"].Value.ToString(); detalle.txtNombres.Text = dataGridView1.CurrentRow.Cells["Nombre_completo"].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.boxBus.Text = dataGridView1.CurrentRow.Cells["placa"].Value.ToString(); detalle.bus = dataGridView1.CurrentRow.Cells["placa"].Value.ToString(); detalle.chkEstado.Checked = checkBox1.Checked; DialogResult rpta = detalle.ShowDialog(); if (rpta == DialogResult.OK) { mostrar_datos(); } } }
private void btnAgregar_Click(object sender, EventArgs e) { DetalleChofer detalle = new DetalleChofer(); detalle.StartPosition = FormStartPosition.CenterScreen; detalle.operacion = (byte)MisConstantes.OPERACION.Insercion; DialogResult rpta = detalle.ShowDialog(); if (rpta == DialogResult.OK) { mostrar_datos(); } }