Example #1
0
        public void DeleteCommande(int i)
        {
            CommandeWPF wpf = Commandes.Where(p => p.commandeId == i).FirstOrDefault();

            Commandes.Remove(wpf);
            DalCom.Delete(i);
        }
Example #2
0
        private void FaireGetEdit(int obj)
        {
            CommandeWPF wpf = Main.Data.Commandes.Where(c => c.commandeId == obj).FirstOrDefault();

            BiereId  = 0;
            Id       = wpf.commandeId;
            Quantite = wpf.commandeQuantite;
        }
Example #3
0
        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);
        }
Example #4
0
        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);
        }
Example #5
0
        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);
        }
Example #6
0
 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());
 }
Example #7
0
        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;
            }
        }
Example #8
0
 public void AjouterCommande(CommandeWPF a)
 {
     a.commandeId = DalCom.Create(a.GetCommandeDal());
     // a.commandeId = DalCom.GetAll().LastOrDefault().commandeId;
     Commandes.Add(a);
 }