private void AgregerPanierEnBase() { if (Client != null && Client.Id != 0) { PanierDAL lePanierDal = new PanierDAL(Client.Id); foreach (ArticleViewModel article in PanierViewModel.ArticlesDetailsViewModel) { Panier panier = lePanierDal.ListerPanierClient().Find(pan => pan.ArticleId == article.Article.Id); if (panier == null) { lePanierDal.Ajouter(article.Article, article.Quantite); } else { lePanierDal.ModifierQuantite(article.Article, article.Quantite); } } } }
private void RecupererPanierProspectPuisSupprimer() { PanierProspectDAL panierProspectDAL = new PanierProspectDAL(ProspectGuid); PanierViewModel panierViewModelSauv = new PanierViewModel(panierProspectDAL.ListerPanierProspect()); if (panierViewModelSauv != null && Client.Id != 0) { PanierDAL panierDal = new PanierDAL(Client.Id); foreach (ArticleViewModel article in (panierViewModelSauv).ArticlesDetailsViewModel) { Panier panier = panierDal.ListerPanierClient().Find(pan => pan.ArticleId == article.Article.Id); if (panier == null) { panierDal.Ajouter(article.Article, article.Quantite); } else { panierDal.ModifierQuantite(article.Article, article.Quantite); } } } panierProspectDAL.Supprimer(); }