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