private void btnUpd_Click(object sender, EventArgs e) { try { ADD_CLIENT frm = new ADD_CLIENT(); frm.ID = Convert.ToInt32(dgvClient.CurrentRow.Cells[0].Value.ToString()); frm.txtName.Text = this.dgvClient.CurrentRow.Cells[1].Value.ToString(); frm.txtPrn.Text = this.dgvClient.CurrentRow.Cells[2].Value.ToString(); frm.txtTele.Text = this.dgvClient.CurrentRow.Cells[3].Value.ToString(); frm.txtEmail.Text = this.dgvClient.CurrentRow.Cells[4].Value.ToString(); frm.cbCity.Text = this.dgvClient.CurrentRow.Cells[5].Value.ToString(); frm.labelAdd_Produit.Text = "Mise à Jour du Client : " + this.dgvClient.CurrentRow.Cells[1].Value.ToString() + " " + this.dgvClient.CurrentRow.Cells[2].Value.ToString(); frm.btnAdd.Text = "Mise à Jour"; frm.state = "Update"; byte[] image = (byte[])cli.GET_IMG_CLIENT(Convert.ToInt32(this.dgvClient.CurrentRow.Cells[0].Value.ToString())).Rows[0][0]; MemoryStream ms = new MemoryStream(image); frm.pbImg.Image = Image.FromStream(ms); frm.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnAjouter_Click(object sender, EventArgs e) { ADD_CLIENT ac = new ADD_CLIENT(); ac.ShowDialog(); }