Ejemplo n.º 1
0
        private void removeDrank()
        {
            Drank deleteD = new Drank();

            Console.Write("Naam drank : ");
            drankenRepo.alleDranken.Remove(drankenRepo.Find(Console.ReadLine()));
            Console.WriteLine("Drank is verwijderd uit het bestand.");
        }
Ejemplo n.º 2
0
        private void addDrank()
        {
            Drank nieuweD = new Drank();

            Console.Write("Naam drank : ");
            nieuweD.Naam = Console.ReadLine();

            bool valid = false;

            while (valid == false)
            {
                Console.Write("Dranktype (Frisdrank, Alcoholisch, Water) : ");
                string inputtype = Console.ReadLine();
                if (inputtype == "Frisdrank")
                {
                    nieuweD.DrankType = Drank.DrankTypes.Frisdrank;
                    valid             = true;
                    break;
                }
                else if (inputtype == "Alcoholisch")
                {
                    nieuweD.DrankType = Drank.DrankTypes.Alcoholisch;
                    valid             = true;
                    break;
                }
                else if (inputtype == "Warm")
                {
                    nieuweD.DrankType = Drank.DrankTypes.Warm;
                    valid             = true;
                    break;
                }
                else if (inputtype == "Water")
                {
                    nieuweD.DrankType = Drank.DrankTypes.Water;
                    valid             = true;
                    break;
                }
                else
                {
                    Console.WriteLine("Dit is geen geldig type drank.");
                    valid = false;
                }
            }
            drankenRepo.alleDranken.Add(nieuweD);
        }
Ejemplo n.º 3
0
 public bool Remove(Drank drank)
 {
     return(alleDranken.Remove(drank));
 }
Ejemplo n.º 4
0
 public void Add(Drank drank)
 {
     alleDranken.Add(drank);
 }