' Collection of code snippets by Arne Vajhøj 
' (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
Imports System
Imports System.Web.UI
Imports System.Web.UI.WebControls

Imports BLL

Namespace PL

    Public Class Transfer
    Inherits Page
        Protected fromaccount As TextBox
        Protected toaccount As TextBox
        Protected amount As TextBox
        Protected transfer As Button
        Protected status As Label
        Private tm As TransferManager

        Protected Overloads Overrides Sub OnInit(ByVal e As EventArgs)
            MyBase.OnInit(e)
            AddHandler transfer.Click, AddressOf transfer_Click
            tm = TransferManagerFactory.Create("strict")
        End Sub

        Protected Sub transfer_Click(ByVal sender As Object, ByVal e As EventArgs)
            If tm.ExecuteTransfer(New TransferData(fromaccount.Text, toaccount.Text, Decimal.Parse(amount.Text))) Then
                fromaccount.Text = ""
                toaccount.Text = ""
                amount.Text = ""
                status.Text = "Money transferred"
            Else
                status.Text = "Money not transferred"
            End If
        End Sub
    End Class 
End Namespace
