// 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) using System; using System.Web.UI; using System.Web.UI.WebControls; using BLL; namespace PL { public class Transfer : Page { protected TextBox fromaccount; protected TextBox toaccount; protected TextBox amount; protected Button transfer; protected Label status; private TransferManager tm; protected override void OnInit(EventArgs e) { base.OnInit(e); transfer.Click += new EventHandler(transfer_Click); tm = TransferManagerFactory.Create("strict"); } protected void transfer_Click(object sender, EventArgs e) { if(tm.ExecuteTransfer(new TransferData(fromaccount.Text, toaccount.Text, decimal.Parse(amount.Text)))) { fromaccount.Text = ""; toaccount.Text = ""; amount.Text = ""; status.Text = "Money transferred"; } else { status.Text = "Money not transferred"; } } } }