public void VerwijderInschrijving(Inschrijving inschrijving) { if (Inschrijvingen.Any(i => i.Gebruiker == inschrijving.Gebruiker)) { Inschrijvingen.Remove(inschrijving); } }
public string Schrijfstatus(string usermail) { if (Inschrijvingen.Any(i => i.Gebruiker.Email == usermail)) { return("Uitschrijven"); } return("Inschrijven"); }
public void VoegInschrijvingToe(Gebruiker gebruiker) { if (Inschrijvingen.Count < Maxplaatsen && gebruiker.Status == GebruikerStatus.ACTIEF) { if (Inschrijvingen.Any(i => i.Gebruiker == gebruiker)) { throw new ArgumentException($"{gebruiker.Naam} is reeds ingeschreven voor deze sessie"); } Inschrijving inschrijving = new Inschrijving(gebruiker, this, DateTime.Now); Inschrijvingen.Add(inschrijving); } else { throw new InvalidOperationException(); } }