private void ValiderLigneCmd_Click(object sender, EventArgs e) { DAL.Commande cmd = new DAL.Commande(RefCmdTextBoxAjoutCmd.Text, Int32.Parse(idclient.Text), DateAjoutCmd.Value.ToString()); if (BALCommande.checkCmd(cmd.NumCmd)) { for (int i = 0; i < nbrLigCmd; i++) { BALLignecmd.deleteLigCmd(cmd.NumCmd); } BALCommande.deleteCmd(cmd.NumCmd); } BALCommande.addCommande(cmd); if (LignesCmdGrid.Rows.Count > 0) { for (int i = 0; i < LignesCmdGrid.Rows.Count; i++) { DAL.Lignecmd l = new DAL.Lignecmd( LignesCmdGrid.Rows[i].Cells[0].Value.ToString(), RefCmdTextBoxAjoutCmd.Text, Int32.Parse(LignesCmdGrid.Rows[i].Cells[2].Value.ToString()), float.Parse(LignesCmdGrid.Rows[i].Cells[3].Value.ToString()) ); BALLignecmd.addLigneCmd(l); } BALCommande.remplirListeCommande(cmddgv); this.Close(); } }
private void ListeCommandedgv_SelectionChanged(object sender, EventArgs e) { if (ListeCommandedgv.SelectedRows.Count > 0) { BALLignecmd.remplirListeLigneCmnd(ListeLigneCmddgv, ListeCommandedgv.SelectedRows[0].Cells[0].Value.ToString()); } }
private void Supprimerbtn_Click(object sender, EventArgs e) { if (ListeCommandedgv.Rows.Count > 0) { for (int i = 0; i < ListeCommandedgv.Rows.Count; i++) { BALLignecmd.deleteLigCmd(ListeCommandedgv.SelectedRows[0].Cells[0].Value.ToString()); } BALCommande.deleteCmd(ListeCommandedgv.SelectedRows[0].Cells[0].Value.ToString()); BALCommande.remplirListeCommande(ListeCommandedgv); ListeLigneCmddgv.Rows.Clear(); } }
private void ValiderAjoutLigCmdbtn_Click(object sender, EventArgs e) { TextBox[] info = { produitInput, TypeTextBoxAjoutLigCmd, DesTextBoxAjoutLig, QuantiteTextBoxAjoutLigcmd, PrixTextBoxAjoutLigCmd }; BALLignecmd.addOrReplaceItem(ligneCmddgv, info); this.Close(); }