private void Btn_Ajouter_Click(object sender, EventArgs e) { A1_1_Form A1_1 = new A1_1_Form(); A1_1.ShowDialog(); this.DG_Produit.DataSource = prd.GET_ALL_PRODUCTS(); }
private void Btn_prd_Modifier_Click(object sender, EventArgs e) { A1_1_Form frm = new A1_1_Form(); frm.state = "update"; frm.txtRef.Text = this.DG_Produit.CurrentRow.Cells[0].Value.ToString(); frm.txtDes.Text = this.DG_Produit.CurrentRow.Cells[1].Value.ToString(); frm.txtQte.Text = this.DG_Produit.CurrentRow.Cells[2].Value.ToString(); frm.txtPrice.Text = this.DG_Produit.CurrentRow.Cells[3].Value.ToString(); frm.cmbCategories.Text = this.DG_Produit.CurrentRow.Cells[4].Value.ToString(); frm.Text = "Modification de : " + this.DG_Produit.CurrentRow.Cells[1].Value.ToString(); frm.btnOk.Text = "Modifier"; frm.txtRef.ReadOnly = true; byte[] image = (byte[])prd.GET_IMAGE_PRODUCT(this.DG_Produit.CurrentRow.Cells[0].Value.ToString()).Rows[0][0]; MemoryStream ms = new MemoryStream(image); frm.pbox.Image = Image.FromStream(ms); frm.ShowDialog(); this.DG_Produit.DataSource = prd.GET_ALL_PRODUCTS(); }