Exemplo 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();
            }
        }
Exemplo n.º 2
0
 private void ListeCommandedgv_SelectionChanged(object sender, EventArgs e)
 {
     if (ListeCommandedgv.SelectedRows.Count > 0)
     {
         BALLignecmd.remplirListeLigneCmnd(ListeLigneCmddgv, ListeCommandedgv.SelectedRows[0].Cells[0].Value.ToString());
     }
 }
Exemplo n.º 3
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();
     }
 }
Exemplo n.º 4
0
 private void ValiderAjoutLigCmdbtn_Click(object sender, EventArgs e)
 {
     TextBox[] info =
     {
         produitInput,
         TypeTextBoxAjoutLigCmd,
         DesTextBoxAjoutLig,
         QuantiteTextBoxAjoutLigcmd,
         PrixTextBoxAjoutLigCmd
     };
     BALLignecmd.addOrReplaceItem(ligneCmddgv, info);
     this.Close();
 }