void BtonNuevoClick(object sender, EventArgs e) { frmDetalleArticulo detalleArticulo=new frmDetalleArticulo(null,consulta); detalleArticulo.ocultaBotonesNuevo(); detalleArticulo.ShowDialog(); }
void BtnDetalleClick(object sender, EventArgs e) { int row=-1; Articulo articulo=null; if (dgvArticulos.CurrentRow != null) { row = dgvArticulos.CurrentRow.Index; if (dgvArticulos.CurrentRow.Cells["Código"].Value != null) { if ((row >= 0) && ((row - 1) <= articulos.Count)) { articulo = articulos[row]; } } } if (articulo!=null){ frmDetalleArticulo detalleArticulo=new frmDetalleArticulo(articulo,consulta); detalleArticulo.bloquearCampos(); detalleArticulo.ShowDialog(); } }