Пример #1
0
 public void OnWinkelverkoop(object source, WinkelEventArgs args)
 {
     stock[args.Bestelling.Product] -= args.Bestelling.Aantal;
     if (stock[args.Bestelling.Product] < 20)
     {
         BestelStock();
     }
 }
Пример #2
0
 public void OnWinkelverkoop(object source, WinkelEventArgs args)
 {
     if (rapport.ContainsKey(args.Bestelling.Adres))
     {
         var value = rapport[args.Bestelling.Adres];
         //value.Add(args.Bestelling);
         var obj = value.FirstOrDefault(x => x.Product == args.Bestelling.Product);
         if (obj != null)
         {
             obj.Aantal += args.Bestelling.Aantal;
         }
         else
         {
             value.Add(args.Bestelling);
         }
     }
     else
     {
         List <Bestelling> bestellingsList = new List <Bestelling>();
         bestellingsList.Add(args.Bestelling);
         rapport.Add(args.Bestelling.Adres, bestellingsList);
     }
 }