private void button3_Click(object sender, EventArgs e)
        {
            addProduct form = new addProduct();

            form.pid.Text          = dataGridView1.CurrentRow.Cells[0].Value.ToString();
            form.textDes.Text      = dataGridView1.CurrentRow.Cells[1].Value.ToString();
            form.textQuantity.Text = dataGridView1.CurrentRow.Cells[2].Value.ToString();
            form.textPrice.Text    = dataGridView1.CurrentRow.Cells[3].Value.ToString();
            form.cmbCAT.Text       = dataGridView1.CurrentRow.Cells[4].Value.ToString();
            form.Text         = "تحديث بيانات منتج";
            form.btnAdd.Text  = "تحديث";
            form.state        = "update";
            form.pid.ReadOnly = true;
            if (prod.Get_Image(int.Parse(this.dataGridView1.CurrentRow.Cells[0].Value.ToString())).Rows[0][0] != System.DBNull.Value)
            {
                byte[]       image = (byte[])prod.Get_Image(int.Parse(this.dataGridView1.CurrentRow.Cells[0].Value.ToString())).Rows[0][0];
                MemoryStream m     = new MemoryStream(image);
                form.pbox.Image = Image.FromStream(m);
                form.ShowDialog();
            }
            else
            {
                form.pbox.Image = null;
                form.ShowDialog();
            }
        }
Esempio n. 2
0
        private void اضافهمنتججديدToolStripMenuItem_Click(object sender, EventArgs e)
        {
            addProduct form = new addProduct();

            form.ShowDialog();
        }