Ejemplo n.º 1
0
        private void deposit(AccountHolder accountHolder)
        {
            Transcript transcript = new Transcript();

            transcript.transaction_type  = transactTypeCbx.Text;
            transcript.amount            = Convert.ToDouble(amountTbx.Text);
            transcript.account_holder_id = Convert.ToInt32(accountHolderIDLv.Text);
            transcript.save();

            accountHolder.balance += transcript.amount;
            accountHolder.save();
        }
Ejemplo n.º 2
0
        private void withdrawOrTranfer(AccountHolder accountHolder)
        {
            if (Convert.ToDouble(amountTbx.Text) > accountHolder.balance)
            {
                MessageBox.Show("You cannot be over your balance!");
                return;
            }

            Transcript transcript = new Transcript();

            transcript.transaction_type  = transactTypeCbx.Text;
            transcript.amount            = Convert.ToDouble(amountTbx.Text);
            transcript.account_holder_id = Convert.ToInt32(accountHolderIDLv.Text);
            transcript.save();

            accountHolder.balance -= transcript.amount;
            accountHolder.save();

            MessageBox.Show("Succeeded transaction!");
        }