Ejemplo n.º 1
0
        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();
            }
        }
Ejemplo n.º 2
0
 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();
     }
 }
Ejemplo n.º 3
0
 private void remplirListeCommandedgv()
 {
     BALCommande.remplirListeCommande(ListeCommandedgv);
 }