Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            SearchProduct SearchPro = new SearchProduct();

            SearchPro.ShowDialog();
            if (SearchPro.DialogResult == DialogResult.OK)
            {
                TxtIdPro.Text    = SearchPro.dataGridView1.Rows[SearchPro.dataGridView1.CurrentRow.Index].Cells[0].Value.ToString();
                TxtDesPro.Text   = SearchPro.dataGridView1.Rows[SearchPro.dataGridView1.CurrentRow.Index].Cells[1].Value.ToString();
                TxtPricePro.Text = SearchPro.dataGridView1.Rows[SearchPro.dataGridView1.CurrentRow.Index].Cells[2].Value.ToString();
                TxtStock.Text    = SearchPro.dataGridView1.Rows[SearchPro.dataGridView1.CurrentRow.Index].Cells[3].Value.ToString();
            }
        }
Exemplo n.º 2
0
        private void BtnProducts_Click(object sender, EventArgs e)
        {
            SearchProduct SearchPro = new SearchProduct();

            SearchPro.ShowDialog();
            if (SearchPro.DialogResult == DialogResult.OK)
            {
                TxtIDPro.Text = SearchPro.dataGridView1.Rows[SearchPro.dataGridView1.CurrentRow.Index].Cells[0].Value.ToString();
                LblDescriptionProduct.Text = SearchPro.dataGridView1.Rows[SearchPro.dataGridView1.CurrentRow.Index].Cells[1].Value.ToString();
                LblPriceProd.Text          = SearchPro.dataGridView1.Rows[SearchPro.dataGridView1.CurrentRow.Index].Cells[2].Value.ToString();
                lblStock.Text    = SearchPro.dataGridView1.Rows[SearchPro.dataGridView1.CurrentRow.Index].Cells[3].Value.ToString();
                Engine.idproduct = int.Parse(TxtIDPro.Text);
                TxtQty.Focus();
            }
        }