/// <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)); }
public void ModifierProduit(Produit produit) { if (produit.Stock < 0 || produit.Prix <= 0) { throw new ArgumentOutOfRangeException(); } ProduitCommand pc = new ProduitCommand(contexte); pc.Modifier(produit); }
public int AjouterProduit(Produit produit) { if (produit.Stock < 0 || produit.Prix <= 0) { throw new ArgumentOutOfRangeException(); } ProduitCommand pc = new ProduitCommand(contexte); return(pc.Ajouter(produit)); }
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); }
public void ModifierProduit(Products p) { ProduitCommand pc = new ProduitCommand(contexte); pc.Modifier(p); }
public int AjouterProduit(Products p) { ProduitCommand pc = new ProduitCommand(contexte); return(pc.Ajouter(p)); }
public void SupprimerProduit(int id) { ProduitCommand pc = new ProduitCommand(contexte); pc.Supprimer(id); }
public void ModifierProduit(Produit p) { ProduitCommand pc = new ProduitCommand(ctx); pc.Modifier(p); }
public int AjouterProduit(Produit p) { ProduitCommand pc = new ProduitCommand(ctx); return(pc.Ajouter(p)); }
public void DeleteProduit(Produit p) { ProduitCommand pc = new ProduitCommand(contexte); pc.Delete(p); }
public Produit UpdateProduit(Produit p) { ProduitCommand pc = new ProduitCommand(contexte); return(pc.Update(p)); }
public void AddProduit(Produit p) { ProduitCommand pc = new ProduitCommand(contexte); pc.Add(p); }