Exemplo n.º 1
0
        private void showedit_Click(object sender, EventArgs e)
        {
            ClothAddNew addclo = new ClothAddNew();

            addclo.id.Text       = this.dataGridView1.CurrentRow.Cells[0].Value.ToString();
            addclo.desc.Text     = this.dataGridView1.CurrentRow.Cells[1].Value.ToString();
            addclo.quantity.Text = this.dataGridView1.CurrentRow.Cells[2].Value.ToString();
            addclo.price.Text    = this.dataGridView1.CurrentRow.Cells[3].Value.ToString();
            addclo.cmbCat.Text   = this.dataGridView1.CurrentRow.Cells[4].Value.ToString();
            addclo.Subcombo.Text = this.dataGridView1.CurrentRow.Cells[5].Value.ToString();
            addclo.Text          = " :تحديث بيانات العنصر المحدد" + this.dataGridView1.CurrentRow.Cells[1].Value.ToString();
            addclo.add_btn.Text  = "تحديث";
            addclo.state         = "edit";
            addclo.id.ReadOnly   = true;

            byte[] img = (byte[])clo.Get_image(this.dataGridView1.CurrentRow.Cells[0].Value.ToString()).Rows[0]["Item_image"];
            //   MessageBox.Show(Convert.ToString(img));
            // Bitmap bitmap = (Bitmap)clo.Get_image(this.dataGridView1.CurrentRow.Cells[0].Value.ToString()).Rows[0][0];
            MemoryStream ms = new MemoryStream(img);       //bitmap.Save(ms,ImageFormat.Jpeg);

            //  ms.Write(img, 0, img.Length);
            // ms.Position = 0;
            //   System.Drawing.ImageConverter converter = new System.Drawing.ImageConverter();
            //  Image img2 = (Image)converter.ConvertFrom(img);
            addclo.pictureBox1.Image = Image.FromStream(ms);
            addclo.ShowDialog();
            if (addclo.closed)
            {
                this.dataGridView1.DataSource         = clo.ShowAll();
                this.dataGridView1.Columns[6].Visible = false;
            }
        }
Exemplo n.º 2
0
        private void إضافةلبسإالىالجردToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ClothAddNew cloth = new ClothAddNew();

            cloth.Show();
        }