public int GeefAantalPerStatus(ReservatieState status, DateTime startDatum, DateTime eindDatum) { if (status is Geblokkeerd) { int aantal = Reservaties.Where( r => r.KanOverschrijvenMetReservatie(startDatum, eindDatum) && r.ReservatieState is Geblokkeerd) .Sum(r => r.AantalGereserveerd); return(aantal > AantalInCatalogus ? AantalInCatalogus : aantal); } if (status is Gereserveerd) { return(Reservaties.Where(r => r.StartDatum.Equals(startDatum) && r.ReservatieState is Gereserveerd).Sum(r => r.AantalGereserveerd)); } return(0); }
public void ToState(ReservatieState reservatieState) { ReservatieState = reservatieState; ReservatieState.Reservatie = this; }