예제 #1
0
 private void transCompleteMsg(string from, string to, decimal amountTransferred)
 {
     rtbMessage.Text =
         "-------------------------------------------------\n" +
         "                 TRANSFER COMPLETE               \n" +
         "-------------------------------------------------\n" +
         "FROM:\t" + from + "\n" +
         "TO:\t" + to + "\n" +
         "AMOUNT TRANSFERRED:\t" + amountTransferred.ToString("c") + "\n" +
         LandATM.getLoginAccount().receipt();
 }
예제 #2
0
 private void transferAmounts(decimal amount, decimal from, decimal to)
 {
     from -= amount;
     to   += amount;
     if (rbFromChkg.Checked)
     {
         LandATM.getLoginAccount().CheckingAmount = from;
         LandATM.getLoginAccount().SavingsAmount  = to;
     }
     else
     {
         LandATM.getLoginAccount().CheckingAmount = to;
         LandATM.getLoginAccount().SavingsAmount  = from;
     }
 }
예제 #3
0
        private void btnWithdrawal_Click(object sender, EventArgs e)
        {
            Console.WriteLine("Withdraw button clicked");
            decimal withdrawal = 0m;

            if (rbChecking.Checked)
            {
                Console.WriteLine("Withdrawing from Checking");
                if (isValidWithdrawal()) //check if valid data
                {
                    Console.WriteLine("Correct data. Begin withdrawal");
                    withdrawal = Convert.ToDecimal(tbAmount.Text);
                    decimal result = withdrawalProcess(withdrawal, LandATM.getLoginAccount().CheckingAmount);
                    withdrawalMsg("Checking", withdrawal, result);
                    LandATM.getLoginAccount().CheckingAmount = result;
                }
                else
                {
                    errorMessage("Invalid Entry");
                }
            }
            else if (rbSavings.Checked) //If savings checked
            {
                Console.WriteLine("Withdrawaing from Savings");
                if (isValidWithdrawal()) //check if valid data
                {
                    Console.WriteLine("Correct data. Begin withdrawal");
                    //Start withdrawal process
                    withdrawal = Convert.ToDecimal(tbAmount.Text);
                    decimal result = withdrawalProcess(withdrawal, LandATM.getLoginAccount().SavingsAmount);
                    withdrawalMsg("Savings", withdrawal, result);
                    LandATM.getLoginAccount().SavingsAmount = result;
                }
                else
                {
                    errorMessage("Invalid Entry");
                }
            }
            else
            {
                errorMessage("Please choose which account to withdraw from");
            }
        }
예제 #4
0
 private void BalanceForm_Load(object sender, EventArgs e)
 {
     lblBalance.Text = LandATM.getLoginAccount().receipt();
 }
예제 #5
0
 private void TransferForm_Load(object sender, EventArgs e)
 {
     checkingAmount = LandATM.getLoginAccount().CheckingAmount;
     savingsAmount  = LandATM.getLoginAccount().SavingsAmount;
 }
예제 #6
0
 private void rbSavings_CheckedChanged(object sender, EventArgs e)
 {
     checkedMessage("SAVINGS", LandATM.getLoginAccount().SavingsAmount.ToString("c"));
 }
예제 #7
0
 private void rbChecking_CheckedChanged(object sender, EventArgs e)
 {
     checkedMessage("CHECKING", LandATM.getLoginAccount().CheckingAmount.ToString("c"));
 }