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(); }
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; } }
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"); } }
private void BalanceForm_Load(object sender, EventArgs e) { lblBalance.Text = LandATM.getLoginAccount().receipt(); }
private void TransferForm_Load(object sender, EventArgs e) { checkingAmount = LandATM.getLoginAccount().CheckingAmount; savingsAmount = LandATM.getLoginAccount().SavingsAmount; }
private void rbSavings_CheckedChanged(object sender, EventArgs e) { checkedMessage("SAVINGS", LandATM.getLoginAccount().SavingsAmount.ToString("c")); }
private void rbChecking_CheckedChanged(object sender, EventArgs e) { checkedMessage("CHECKING", LandATM.getLoginAccount().CheckingAmount.ToString("c")); }