/// <summary>
        /// Modifier un produit en base
        /// </summary>
        /// <param name="p">Produit à modifier</param>
        public void ModifierProduit(Produit p)
        {
            // TODO : ajouter des contrôles sur le produit (exemple : vérification de champ, etc.)
            ProduitCommand pc = new ProduitCommand(contexte);

            pc.Modifier(p);
        }
        /// <summary>
        /// Ajouter un produit en base
        /// </summary>
        /// <param name="p">Produit à ajouter</param>
        /// <returns>identifiant du nouveau produit</returns>
        public int AjouterProduit(Produit p)
        {
            // TODO : ajouter des contrôles sur le produit (exemple : vérification de champ, etc.)
            ProduitCommand pc = new ProduitCommand(contexte);

            return(pc.Ajouter(p));
        }
Example #3
0
        public void ModifierProduit(Produit produit)
        {
            if (produit.Stock < 0 || produit.Prix <= 0)
            {
                throw new ArgumentOutOfRangeException();
            }

            ProduitCommand pc = new ProduitCommand(contexte);

            pc.Modifier(produit);
        }
Example #4
0
        public int AjouterProduit(Produit produit)
        {
            if (produit.Stock < 0 || produit.Prix <= 0)

            {
                throw new ArgumentOutOfRangeException();
            }

            ProduitCommand pc = new ProduitCommand(contexte);

            return(pc.Ajouter(produit));
        }
Example #5
0
        public void PurgeDatabase()
        {
            CategorieCommand catC = new CategorieCommand(contexte);
            ClientCommand    cliC = new ClientCommand(contexte);
            CommandeCommand  comC = new CommandeCommand(contexte);
            ProduitCommand   proC = new ProduitCommand(contexte);
            StatutCommand    staC = new StatutCommand(contexte);

            catC.Purge();
            cliC.Purge();
            comC.Purge();
            proC.Purge();
            staC.Purge();
        }
        /// <summary>
        /// Supprimer une produit en base
        /// </summary>
        /// <param name="produitID">Identifiant du produit à supprimer</param>
        public void SupprimerProduit(int produitID)
        {
            ProduitCommand pc = new ProduitCommand(contexte);

            pc.Supprimer(produitID);
        }
Example #7
0
        public void ModifierProduit(Products p)
        {
            ProduitCommand pc = new ProduitCommand(contexte);

            pc.Modifier(p);
        }
Example #8
0
        public int AjouterProduit(Products p)
        {
            ProduitCommand pc = new ProduitCommand(contexte);

            return(pc.Ajouter(p));
        }
Example #9
0
        public void SupprimerProduit(int id)
        {
            ProduitCommand pc = new ProduitCommand(contexte);

            pc.Supprimer(id);
        }
Example #10
0
        public void ModifierProduit(Produit p)
        {
            ProduitCommand pc = new ProduitCommand(ctx);

            pc.Modifier(p);
        }
Example #11
0
        public int AjouterProduit(Produit p)
        {
            ProduitCommand pc = new ProduitCommand(ctx);

            return(pc.Ajouter(p));
        }
Example #12
0
        public void DeleteProduit(Produit p)
        {
            ProduitCommand pc = new ProduitCommand(contexte);

            pc.Delete(p);
        }
Example #13
0
        public Produit UpdateProduit(Produit p)
        {
            ProduitCommand pc = new ProduitCommand(contexte);

            return(pc.Update(p));
        }
Example #14
0
        public void AddProduit(Produit p)
        {
            ProduitCommand pc = new ProduitCommand(contexte);

            pc.Add(p);
        }