Ejemplo n.º 1
0
        public override void MakeWithdrawal(decimal withdrawal, DateTime dateTime)
        {
            AccountManager accountManager = new AccountManager();

            if (dateTime < DateOfTransaction.AddYears(1))
            {
                Console.WriteLine("Cannot make a withdrawal until end of term");
            }
            else if (withdrawal != Balance)
            {
                Console.WriteLine("Must withdraw full amount from your Certificate Deposit");
            }
            else
            {
                string withdrawalString = withdrawal.ToString();
                WithdrawalString = "+$" + withdrawalString;
                WithdrawalAmount = withdrawal;
                Balance         -= withdrawal;
                var completeWithdrawal = new Transaction(Balance, WithdrawalString, WithdrawalAmount, dateTime);
                transactions.Add(completeWithdrawal);
                UI.CloseCDOnWithdrawal();
                Console.WriteLine("This account will now be closed.");
                UI.OnEnterPress();
                Program.ExecuteUserInput();
            }
        }
Ejemplo n.º 2
0
        void ReleaseDesignerOutlets()
        {
            if (AmountDue != null)
            {
                AmountDue.Dispose();
                AmountDue = null;
            }

            if (btnAddNewCard != null)
            {
                btnAddNewCard.Dispose();
                btnAddNewCard = null;
            }

            if (btnRetry != null)
            {
                btnRetry.Dispose();
                btnRetry = null;
            }

            if (DateOfTransaction != null)
            {
                DateOfTransaction.Dispose();
                DateOfTransaction = null;
            }

            if (IbsOrder != null)
            {
                IbsOrder.Dispose();
                IbsOrder = null;
            }

            if (lblAmountDue != null)
            {
                lblAmountDue.Dispose();
                lblAmountDue = null;
            }

            if (lblDate != null)
            {
                lblDate.Dispose();
                lblDate = null;
            }

            if (lblInstructions != null)
            {
                lblInstructions.Dispose();
                lblInstructions = null;
            }

            if (lblOrderId != null)
            {
                lblOrderId.Dispose();
                lblOrderId = null;
            }

            if (lblTransactionId != null)
            {
                lblTransactionId.Dispose();
                lblTransactionId = null;
            }

            if (TransactionId != null)
            {
                TransactionId.Dispose();
                TransactionId = null;
            }

            if (lblSelectedCreditCard != null)
            {
                lblSelectedCreditCard.Dispose();
                lblSelectedCreditCard = null;
            }

            if (lblNoCreditCard != null)
            {
                lblNoCreditCard.Dispose();
                lblNoCreditCard = null;
            }

            if (lblCompany != null)
            {
                lblCompany.Dispose();
                lblCompany = null;
            }

            if (Company != null)
            {
                Company.Dispose();
                Company = null;
            }

            if (lblLast4 != null)
            {
                lblLast4.Dispose();
                lblLast4 = null;
            }

            if (Last4 != null)
            {
                Last4.Dispose();
                Last4 = null;
            }
        }