private void btnedit_Click(object sender, EventArgs e) { add_product frm = new add_product(); frm.txtref.Text = this.dataGridView1.CurrentRow.Cells[0].Value.ToString(); frm.txtdes.Text = this.dataGridView1.CurrentRow.Cells[1].Value.ToString(); frm.txtqte.Text = this.dataGridView1.CurrentRow.Cells[2].Value.ToString(); frm.txtprice.Text = this.dataGridView1.CurrentRow.Cells[3].Value.ToString(); frm.cmbcategories.Text = this.dataGridView1.CurrentRow.Cells[4].Value.ToString(); frm.Text = "تجديث المنتج" + this.dataGridView1.CurrentRow.Cells[1].Value.ToString(); frm.ok.Text = "تحديث"; frm.state = "update"; frm.txtref.ReadOnly = true; frm.ShowDialog(); }
private void buttonX1_Click_1(object sender, EventArgs e) { try { if (dataGridView1.CurrentRow.Cells[5].Value is DBNull) { add_product frm = new add_product(); frm.txtref.Text = this.dataGridView1.CurrentRow.Cells[0].Value.ToString(); frm.txtdes.Text = this.dataGridView1.CurrentRow.Cells[1].Value.ToString(); frm.txtqte.Text = this.dataGridView1.CurrentRow.Cells[2].Value.ToString(); frm.txtprice.Text = this.dataGridView1.CurrentRow.Cells[3].Value.ToString(); frm.cmbcategories.Text = this.dataGridView1.CurrentRow.Cells[4].Value.ToString(); frm.Text = "تجديث المنتج" + " " + this.dataGridView1.CurrentRow.Cells[1].Value.ToString(); frm.ok.Text = "تحديث"; frm.state = "update"; frm.txtref.ReadOnly = true; frm.ShowDialog(); } else { add_product frm = new add_product(); frm.txtref.Text = this.dataGridView1.CurrentRow.Cells[0].Value.ToString(); frm.txtdes.Text = this.dataGridView1.CurrentRow.Cells[1].Value.ToString(); frm.txtqte.Text = this.dataGridView1.CurrentRow.Cells[2].Value.ToString(); frm.txtprice.Text = this.dataGridView1.CurrentRow.Cells[3].Value.ToString(); frm.cmbcategories.Text = this.dataGridView1.CurrentRow.Cells[4].Value.ToString(); frm.Text = "تجديث المنتج" + this.dataGridView1.CurrentRow.Cells[1].Value.ToString(); frm.ok.Text = "تحديث"; frm.state = "update"; frm.txtref.ReadOnly = true; byte[] image = (byte[])prd.GET_IMAGE_PRODUCTS(this.dataGridView1.CurrentRow.Cells[0].Value.ToString()).Rows[0][0]; MemoryStream ms = new MemoryStream(image); frm.pictureBox1.Image = Image.FromStream(ms); frm.ShowDialog(); } } catch { return; } }
private void اضافهصنفToolStripMenuItem_Click(object sender, EventArgs e) { add_product Form = new add_product(); Form.Show(); }
private void btnadd_Click(object sender, EventArgs e) { add_product frm = new add_product(); frm.Show(); }
//display addProduct form private void buttonItem3_Click(object sender, EventArgs e) { add_product FRM = new add_product(); FRM.ShowDialog(); }