private void btnModificar_Click(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count > 0) { ProveedorDetalleUI detalle = new ProveedorDetalleUI(); detalle.StartPosition = FormStartPosition.CenterParent; detalle.operacion = (byte)MisConstantes.OPERACION.Modificacion; detalle.lblID.Text = dataGridView1.CurrentRow.Cells["ID"].Value.ToString(); detalle.txtRazonSocial.Text = dataGridView1.CurrentRow.Cells["Razon_Social"].Value.ToString(); detalle.txtRUC.Text = dataGridView1.CurrentRow.Cells["RUC"].Value.ToString(); detalle.txtDireccion.Text = dataGridView1.CurrentRow.Cells["Direccion"].Value.ToString(); detalle.txtTelefono.Text = dataGridView1.CurrentRow.Cells["Telefono"].Value.ToString(); detalle.txtMail.Text = dataGridView1.CurrentRow.Cells["Mail"].Value.ToString(); detalle.chkEstado.Checked = chkEstado1.Checked; DialogResult rpta = detalle.ShowDialog(); if (rpta == DialogResult.OK) { mostrarDatos(); } } }
private void btnAgregar_Click(object sender, EventArgs e) { ProveedorDetalleUI detalle = new ProveedorDetalleUI(); detalle.StartPosition = FormStartPosition.CenterScreen; detalle.chkEstado.Checked = true; detalle.operacion = (byte)MisConstantes.OPERACION.Insercion; DialogResult rpta = detalle.ShowDialog(); if (rpta == DialogResult.OK) { mostrarDatos(); } }