예제 #1
0
파일: Sales.cs 프로젝트: AaronFrans/Prog3
        public void OnVerkoop(object source, WinkelEventArgs e)
        {
            bool isFound = false;

            for (int i = 0; i < Transactions.Count; i++)
            {
                if (e.Bestelling.Adres == Transactions.ElementAt(i).Key)
                {
                    Transactions.ElementAt(i).Value.Add(e.Bestelling);
                    isFound = true;
                    i       = Transactions.Count + 1;
                }
            }
            if (isFound == false)
            {
                List <Bestelling> bestellingen = new List <Bestelling>()
                {
                    e.Bestelling
                };
                Transactions.Add(e.Bestelling.Adres, bestellingen);
            }


            Console.WriteLine("Raport gemaakt");
        }
예제 #2
0
        public void OnVerkoop(object source, WinkelEventArgs e)
        {
            Stock[e.Bestelling.Product] = Stock[e.Bestelling.Product] - e.Bestelling.Aantal;

            if (Stock[e.Bestelling.Product] < min)
            {
                Console.WriteLine($"Replace Stock to {max}  items");
                HervulStock();
            }
            Console.WriteLine("Verkocht");
        }