private void btnAnnuler_Click(object sender, EventArgs e) { ll = new BALLigCmd(); ll.deleteLigCmd(ch1); this.Dispose(); }
private void btnSupprimer_Click(object sender, EventArgs e) { if (dataGridLigneCmd.SelectedRows.Count == 0) { MessageBox.Show("Selectionner la ligne entiere." + "\n" + "Cliquer sur le curseur à gauche du datagid", "Erreur de selection", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (MessageBox.Show("Voulez vous supprimer ce ligne de commande?", "Confirmation de la suppression", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { ll = new BALLigCmd(); ll.deleteLigCmd1(ch1, dataGridLigneCmd.SelectedRows[0].Cells[1].Value.ToString(), dataGridLigneCmd.SelectedRows[0].Cells[2].Value.ToString()); remplirDatagrdview(); } }
private void btnValider_Click(object sender, EventArgs e) { bl = new BALLigCmd(); dl = new LigCmd(); /* dl.NumCmd = Int32.Parse(reef); * dl.CodeProduit = txtProduit.Text; * dl.Qte = Int32.Parse(txtQte.Text); * dl.Prix = Int32.Parse(txtPrix.Text);*/ OleDbConnection ccn = new OleDbConnection(); ccn = Global.seConnecter(Global.cs); string codeprd = "'" + txtProduit.Text + "'"; Global.ExecuterOleDbAction(@"update LigCmd set LigCmd.Qte = " + Int32.Parse(txtQte.Text) + ", LigCmd.Prix = " + Int32.Parse(txtPrix.Text) + " where LigCmd.CodeProduit = " + codeprd + " and LigCmd.NumCmd = " + Int32.Parse(reef), ccn); Global.seDeconnecter(ccn); Ajout f1 = new Ajout(reef, idClient); OleDbConnection cn = new OleDbConnection(); OleDbDataReader lect; cn = Global.seConnecter(Global.cs); lect = Global.ExecuterOleDBSelect(@"select * from Client where NumClient =" + idClient, cn); while (lect.Read()) { f1.txtClient.Text = lect.GetValue(1).ToString(); f1.txtRue.Text = lect.GetValue(2).ToString(); f1.txtVille.Text = lect.GetValue(3).ToString(); f1.txtCodePostal.Text = lect.GetValue(4).ToString(); f1.txtTel.Text = lect.GetValue(5).ToString(); } Global.seDeconnecter(cn); lect.Close(); this.Dispose(); f1.ShowDialog(); }
private void btnValider_Click(object sender, EventArgs e) { int res; bl = new BALLigCmd(); dl = new LigCmd(); dl.NumCmd = Int32.Parse(reef); dl.CodeProduit = txtProduit.Text; dl.Qte = Int32.Parse(txtQte.Text); dl.Prix = Int32.Parse(txtPrix.Text); res = bl.AjouterLigCmd(dl); if (res == 1) { Ajout f1 = new Ajout(reef, idClient); OleDbConnection cn = new OleDbConnection(); OleDbDataReader lect; cn = Global.seConnecter(Global.cs); lect = Global.ExecuterOleDBSelect(@"select * from Client where NumClient =" + idClient, cn); while (lect.Read()) { f1.txtClient.Text = lect.GetValue(1).ToString(); f1.txtRue.Text = lect.GetValue(2).ToString(); f1.txtVille.Text = lect.GetValue(3).ToString(); f1.txtCodePostal.Text = lect.GetValue(4).ToString(); f1.txtTel.Text = lect.GetValue(5).ToString(); } Global.seDeconnecter(cn); lect.Close(); this.Dispose(); f1.ShowDialog(); } else { MessageBox.Show("Echec Ajout de Ligne Comm."); } }