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."); }
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); }
public bool Remove(Drank drank) { return(alleDranken.Remove(drank)); }
public void Add(Drank drank) { alleDranken.Add(drank); }