Exemple #1
0
        private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            PConsProducto doform = new PConsProducto();

            if (doform.ShowDialog() == DialogResult.OK)
            {
                int pos = doform.dgvdata.CurrentCell.RowIndex;
                txtcodpro.Text  = doform.dgvdata.Rows[pos].Cells["idproducto"].Value.ToString();
                txtnompro.Text  = doform.dgvdata.Rows[pos].Cells["nombre"].Value.ToString();
                txtprevent.Text = doform.dgvdata.Rows[pos].Cells["precio"].Value.ToString();
                txtcantvent.Focus();
            }
        }
        private void btnbuscar_Click(object sender, EventArgs e)
        {
            PConsProducto doform = new PConsProducto();

            if (doform.ShowDialog() == DialogResult.OK)
            {
                int pos = doform.dgvdata.CurrentCell.RowIndex;
                txtcodigo.Text       = doform.dgvdata.Rows[pos].Cells["idproducto"].Value.ToString();
                txtcodcategoria.Text = doform.dgvdata.Rows[pos].Cells["idcategoria"].Value.ToString();
                txtcodproveedor.Text = doform.dgvdata.Rows[pos].Cells["idproveedor"].Value.ToString();
                txtnombre.Text       = doform.dgvdata.Rows[pos].Cells["nombre"].Value.ToString();
                txtprecio.Text       = doform.dgvdata.Rows[pos].Cells["precio"].Value.ToString();
                txtstock.Text        = doform.dgvdata.Rows[pos].Cells["stock"].Value.ToString();
                txtpuntreo.Text      = doform.dgvdata.Rows[pos].Cells["punto_reorden"].Value.ToString();
                txtimpuesto.Text     = doform.dgvdata.Rows[pos].Cells["impuesto"].Value.ToString();
            }
        }