//les Customers: #region "les Customers" private void button20_Click(object sender, EventArgs e) { A3.A3_add_cust frm1 = new A3.A3_add_cust(); frm1.btnSave.Text = "Enregistrer"; frm1.ShowDialog(); DG_Cust.DataSource = cust.GET_ALL_CUSTOMERS(); }
private void button19_Click(object sender, EventArgs e) { id = Convert.ToInt32(DG_Cust.CurrentRow.Cells[0].Value); if (id == 0) { MessageBox.Show("Client Non Disponible"); return; } if (MessageBox.Show("Voulez Vous Supprimer Le client?", "Suppression", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { A3.A3_add_cust frm1 = new A3.A3_add_cust(); cust.DELETE_CUSTOMER(id); this.DG_Cust.DataSource = cust.GET_ALL_CUSTOMERS(); } }
private void button18_Click(object sender, EventArgs e) { try { A3.A3_add_cust frm = new A3.A3_add_cust(); frm.btnSave.Text = "Modifier"; frm.id = Convert.ToInt32(DG_Cust.CurrentRow.Cells[0].Value); frm.txtLastName.Text = DG_Cust.CurrentRow.Cells[1].Value.ToString(); frm.txtFirstName.Text = DG_Cust.CurrentRow.Cells[2].Value.ToString(); frm.txtTel.Text = DG_Cust.CurrentRow.Cells[3].Value.ToString(); frm.txtEmail.Text = DG_Cust.CurrentRow.Cells[4].Value.ToString(); byte[] Picture = (byte[])DG_Cust.CurrentRow.Cells[5].Value; MemoryStream ms = new MemoryStream(Picture); frm.pbox.Image = Image.FromStream(ms); frm.ShowDialog(); } catch { A3.A3_add_cust frm = new A3.A3_add_cust(); frm.id = Convert.ToInt32(DG_Cust.CurrentRow.Cells[0].Value); frm.txtLastName.Text = DG_Cust.CurrentRow.Cells[1].Value.ToString(); frm.txtFirstName.Text = DG_Cust.CurrentRow.Cells[2].Value.ToString(); frm.txtTel.Text = DG_Cust.CurrentRow.Cells[3].Value.ToString(); frm.txtEmail.Text = DG_Cust.CurrentRow.Cells[4].Value.ToString(); frm.btnSave.Text = "Modifier"; frm.ShowDialog(); } DG_Cust.DataSource = cust.GET_ALL_CUSTOMERS(); }