protected void btnTransfer_Click(object sender, EventArgs e)
        {
            bool success = false;

            int fromAccount, toAccount, amount;
            string description = txtDescription.Text;
            string transType = "Transfer";
            DateTime stamp = DateTime.Now;
            string transRef = "Online Transfer";

            fromAccount = int.Parse(txtAccountNumber.Text);
            toAccount = int.Parse(txtToAccountNumber.Text);
            amount = int.Parse(txtAmount.Text);

            
                Transaction newTransaction = new Transaction();
                newTransaction.TransactionAccountNumber = fromAccount;
                newTransaction.DestinationAccountNumber = toAccount;
                newTransaction.TransactionType = transType;
                newTransaction.TransactionReference = transRef;
                newTransaction.TransactionAmount = amount;
                newTransaction.TransactionDateTime = stamp;
                newTransaction.TransactionDescription = description;

                using (var _db = new CustomerContext())
                {
                    try
                    {
                        _db.Transactions.Add(newTransaction);
                        success = true;
                        _db.SaveChanges();
                    }
                    catch (Exception ex)
                    {
                        FireBugWriter.Write(ex.Message);
                    }
                }


                using (var db = new CustomerContext())
                {
                    int deductAmount = int.Parse(txtAmount.Text);
                    int accountNumber = int.Parse(txtAccountNumber.Text);
                    try
                    {
                        var query = (from a in db.Accounts
                                     where a.AccountNumber == accountNumber
                                     select a).First();

                        int newBalance = query.Balance - deductAmount;
                        query.Balance = newBalance;
                        db.SaveChanges();
                    }
                    catch (Exception ex)
                    {
                        FireBugWriter.Write(ex.Message);
                    }
                }
                using (var db = new CustomerContext())
                {
                    int addAmount = int.Parse(txtAmount.Text);
                    int destinationAccount = int.Parse(txtToAccountNumber.Text);
                    try
                    {
                        var query = (from a in db.Accounts
                                     where a.AccountNumber == destinationAccount
                                     select a).First();

                        int newBalance = query.Balance + addAmount;
                        query.Balance = newBalance;
                        db.SaveChanges();
                    }
                    catch (Exception ex)
                    {
                        FireBugWriter.Write(ex.Message);
                    }
                }
                if (success)
                {
                    txtAmount.Text = string.Empty;
                    txtDescription.Text = string.Empty;
                    txtReference.Text = string.Empty;
                    txtToAccountNumber.Text = string.Empty;
                }
        }
        protected void btnTransfer_Click(object sender, EventArgs e)
        {
            bool success = false;

            int fromAccount, toAccount, amount;
            string description = txtDescription.Text;
            string transType = "Transfer";
            DateTime stamp = DateTime.Now;
            string transRef = "Online Transfer";

            fromAccount = int.Parse(txtFromAccount.Text);
            toAccount = int.Parse(txtToAccount.Text);
            amount = int.Parse(txtAmount.Text);

            
                Transaction newTransaction = new Transaction();
                newTransaction.TransactionAccountNumber = fromAccount;
                newTransaction.DestinationAccountNumber = toAccount;
                newTransaction.TransactionType = transType;
                newTransaction.TransactionReference = transRef;
                newTransaction.TransactionAmount = amount;
                newTransaction.TransactionDateTime = stamp;
                newTransaction.TransactionDescription = description;

                using (var _db = new CustomerContext())
                {
                    try
                    {
                        _db.Transactions.Add(newTransaction);
                        success = true;
                        _db.SaveChanges();
                        UpdateBalance();

                        if (success)
                        {
                            txtFromAccount.Text = string.Empty;
                            txtToAccount.Text = string.Empty;
                            txtAmount.Text = string.Empty;
                        }
                    }
                    catch (Exception ex)
                    {
                        FireBugWriter.Write(ex.Message);
                    }
                }
        }