100
return Cursistnummer + ": " + Voornaam + " " + Achternaam + " - " + Geboortedatum.ToShortDateString();
1
using System;
2
3
public class Persoon
4
{
5
public string Achternaam { get; set; }
6
public string Voornaam { get; set; }
7
private DateTime _GeboorteDatum;
8
9
public DateTime Geboortedatum
10
{
11
get { return _GeboorteDatum; }
12
set
13
{
14
if (DateTime.Compare(value, DateTime.Today) != 1)
15
{
16
_GeboorteDatum = value;
17
}
18
else
19
{
20
throw new Exception("De geboortedatum mag niet in de toekomst liggen!");
21
}
22
}
23
}
24
Cached Result
Ninove = 0
Zottegem = 2
Zottegem = 2