Пример #1
0
        public static void MethodeNieuweSchotel()
        {
            Menu.MethodeBannerLine("0");
            Console.WriteLine(" Geef de naam in van de schotel:");
            Schotel nieuw = new Schotel(Console.ReadLine());

            Console.Clear();
            nieuw.MethodeNieuweSchotel();
            List <Product> producten = Data.GetProduct();

            foreach (var item in nieuw.IDlijst)
            {
                if (producten[item.Key - 1].Voorraad < item.Value)
                {
                    Console.WriteLine(" Je kan de schotel niet maken, er zijn niet voldoende producten!!!\nDruk op een knop om terug te keren.");
                    Console.Clear();
                    MenuSchotelHoofdmenu();
                }

                // producten[item.Key].Voorraad -= item.Value; beestje..
            }
            Data.AddSchotel(nieuw);
            Data.SetProduct(producten);
            Console.Clear();
            MenuSchotelHoofdmenu();
        }
Пример #2
0
        public static void AddSchotel(Schotel input)
        {
            List <Schotel> SchotelenData       = new List <Schotel>();
            List <object>  SchotelenDataObjUIT = Serializer.BinaryDeserialize("Schotels.bin");

            if (SchotelenDataObjUIT != null)
            {
                SchotelenData = SchotelenDataObjUIT.Cast <Schotel>().ToList();
            }
            SchotelenData.Add(input);
            List <object> SchotelenDataObjIN = SchotelenData.Cast <object>().ToList();

            Serializer.BinarySerialize(SchotelenDataObjIN, "Schotels.bin");
        }
Пример #3
0
        public static void OverzichtSchotelEnkel(int schotelID)
        {
            Schotel        objectSelectie  = Data.GetSchotel().Find(delegate(Schotel del) { return(del.ID == schotelID); });
            List <Product> productSelectie = Data.GetProduct();

            if (!objectSelectie.Actief)
            {
                Console.WriteLine($"\n\tLET OP: DEZE SCHOTEL WERD VERWIJDERD");
            }
            Console.WriteLine($"\n\tID: {objectSelectie.ID}\n\tNaam: {objectSelectie.Naam} \n\tPrijs: {objectSelectie.Prijs}\n\tVoorraad: {objectSelectie.Voorraad}\n\t");
            if (objectSelectie.IDlijst.Count != 0)
            {
                Console.WriteLine("Producten:");
            }
            foreach (var item in objectSelectie.IDlijst)
            {
                Console.WriteLine($" Product {productSelectie[item.Key - 1].Naam}: {item.Value} stuks.");
            }
        }