public void DeleteCommande(int i) { CommandeWPF wpf = Commandes.Where(p => p.commandeId == i).FirstOrDefault(); Commandes.Remove(wpf); DalCom.Delete(i); }
private void FaireGetEdit(int obj) { CommandeWPF wpf = Main.Data.Commandes.Where(c => c.commandeId == obj).FirstOrDefault(); BiereId = 0; Id = wpf.commandeId; Quantite = wpf.commandeQuantite; }
public static CommandeWPF GetCommandeWPF(this Commande vm) { CommandeWPF wpf = new CommandeWPF(); wpf.biereId = vm.BiereId; wpf.clientId = vm.ClientId; wpf.commandeDate = DateTime.Now; wpf.commandeId = vm.Id; wpf.commandeQuantite = vm.Quantite; return(wpf); }
public static CommandeDal GetCommandeDal(this CommandeWPF wpf) { CommandeDal dal = new CommandeDal(); dal.biereId = wpf.biereId; dal.clientId = wpf.clientId; dal.commandeDate = wpf.commandeDate; dal.commandeId = wpf.commandeId; dal.commandeQuantite = wpf.commandeQuantite; return(dal); }
public static CommandeWPF GetCommandeWPF(this CommandeDal dal) { CommandeWPF wpf = new CommandeWPF(); wpf.biereId = dal.biereId; wpf.clientId = dal.clientId; wpf.commandeDate = dal.commandeDate; wpf.commandeId = dal.commandeId; wpf.commandeQuantite = dal.commandeQuantite; return(wpf); }
public void EditerCommande(CommandeWPF b) { if (Commandes.Count() > 0) { for (int i = 0; i < Commandes.Count(); i++) { if (Commandes[i].commandeId == b.commandeId) { Commandes[i].biereId = b.biereId; Commandes[i].commandeQuantite = b.commandeQuantite; i = Commandes.Count() + 2; } } } DalCom.Update(b.GetCommandeDal()); }
private void FaireGetDetail(int obj) { CommandeWPF wpf = Main.Data.Commandes.Where(p => p.commandeId == obj).FirstOrDefault(); if (wpf.biereId != null) { BiereNom = Main.Data.Bieres.Where(b => b.biereId == wpf.biereId).FirstOrDefault().biereNom; } Quantite = wpf.commandeQuantite; Id = wpf.commandeId; Date = wpf.commandeDate; if (wpf.clientId != null) { Login = Main.Data.Clients.Where(c => c.clientId == wpf.clientId).FirstOrDefault().clientLogin; } }
public void AjouterCommande(CommandeWPF a) { a.commandeId = DalCom.Create(a.GetCommandeDal()); // a.commandeId = DalCom.GetAll().LastOrDefault().commandeId; Commandes.Add(a); }