hello,
I made a console application that show when someone get 100 euro from a bankaccount his bankaccount is in negatief with 100. when I look at my code and to the errors list, nothing is wrong. no runtime errors but when I use the debugger nothing is on the sreen. anybody know what I have forgot?
Class Bankrekening
Public Event NegatiefSaldoBekomen As EventHandler(Of NegatiefSaldoBekomenEventargs)
Public Property Nummer As String
Protected _Saldo As Decimal
Public Sub Stort(ByVal bedrag As Decimal)
_Saldo += bedrag
End Sub
Public Sub HaalAf(ByVal bedrag As Decimal)
_Saldo -= bedrag
End Sub
Public ReadOnly Property Saldo As Decimal
Get
Saldo = _Saldo
End Get
End Property
End Class
Class NegatiefSaldoBekomenEventArgs : Inherits EventArgs
Public Property NegatiefSaldo As Decimal
End Class
Module BankrekeningClient
Sub Main()
Dim bankrekening1 As New Bankrekening With {.Nummer = "0001"}
Dim bankrekening2 As New Bankrekening With {.Nummer = "0002"}
AddHandler bankrekening1.AddressOf, Bankrekening_NegatiefSaldoBekomen()
AddHandler bankrekening2.AddressOf, Bankrekening_NegatiefSaldoBekomen()
bankrekening1.HaalAf(100)
' eventafhandling : Bankaccount with number 0001 have got a negatief saldo off 100 .
bankrekening2.HaalAf(200)
' eventafhandling : Bankaccount with number 0001 have got a negatief saldo off 100 .
Console.ReadLine()
End Sub
Sub bankrekening1_NegatiefSaldoBekomen(ByVal sender As Bankrekening,
ByVal e As NegatiefSaldoBekomenEventArgs)
Console.WriteLine("Bankrekening with number " & sender.Number &
" have got a negatief saldo off " & e.NegatiefSaldo)
End Sub
Private Function Bankrekening_NegatiefSaldoBekomen() As Object
Throw New NotImplementedException
End Function
End Module
line (*) makes that the eventafhandeling were the message "Bankrekening met nummmer 0001 a negatief saldo have become off -100." is written on console.
line (**) makes that the eventafhandeling were the message "Bankrekening met nummmer 0002 a negatief saldo have become off -200." is written on console.
greets
I made a console application that show when someone get 100 euro from a bankaccount his bankaccount is in negatief with 100. when I look at my code and to the errors list, nothing is wrong. no runtime errors but when I use the debugger nothing is on the sreen. anybody know what I have forgot?
Class Bankrekening
Public Event NegatiefSaldoBekomen As EventHandler(Of NegatiefSaldoBekomenEventargs)
Public Property Nummer As String
Protected _Saldo As Decimal
Public Sub Stort(ByVal bedrag As Decimal)
_Saldo += bedrag
End Sub
Public Sub HaalAf(ByVal bedrag As Decimal)
_Saldo -= bedrag
End Sub
Public ReadOnly Property Saldo As Decimal
Get
Saldo = _Saldo
End Get
End Property
End Class
Class NegatiefSaldoBekomenEventArgs : Inherits EventArgs
Public Property NegatiefSaldo As Decimal
End Class
Module BankrekeningClient
Sub Main()
Dim bankrekening1 As New Bankrekening With {.Nummer = "0001"}
Dim bankrekening2 As New Bankrekening With {.Nummer = "0002"}
AddHandler bankrekening1.AddressOf, Bankrekening_NegatiefSaldoBekomen()
AddHandler bankrekening2.AddressOf, Bankrekening_NegatiefSaldoBekomen()
bankrekening1.HaalAf(100)
' eventafhandling : Bankaccount with number 0001 have got a negatief saldo off 100 .
bankrekening2.HaalAf(200)
' eventafhandling : Bankaccount with number 0001 have got a negatief saldo off 100 .
Console.ReadLine()
End Sub
Sub bankrekening1_NegatiefSaldoBekomen(ByVal sender As Bankrekening,
ByVal e As NegatiefSaldoBekomenEventArgs)
Console.WriteLine("Bankrekening with number " & sender.Number &
" have got a negatief saldo off " & e.NegatiefSaldo)
End Sub
Private Function Bankrekening_NegatiefSaldoBekomen() As Object
Throw New NotImplementedException
End Function
End Module
line (*) makes that the eventafhandeling were the message "Bankrekening met nummmer 0001 a negatief saldo have become off -100." is written on console.
line (**) makes that the eventafhandeling were the message "Bankrekening met nummmer 0002 a negatief saldo have become off -200." is written on console.
greets