Beispiel #1
0
        // islem yapilabiliyor mu
        private bool IsWithrawal(int val)
        {
            // cekebilecegin para var mi?
            if (val <= Database.getAvaibleBalance(AccountNumber))
            {
                // ATM de para var mi
                if (cashDispenser.IsSufficiantCashAvaible(val))
                {
                    Database.Debit(AccountNumber, val);
                    cashDispenser.DispenseCash(val);
                    return(true);
                }
                else
                {
                    UserScreen.DisplayMessageLine("ERROR: money in ATM is not enough!");
                    UserScreen.Sleep(3000);
                }
            }
            else
            {
                UserScreen.DisplayMessage("\nERROR: your avaible balance: ");
                UserScreen.DisplayDollarAmount(Database.getAvaibleBalance(AccountNumber));
                UserScreen.Sleep(2000);
            }

            return(false);
        }
Beispiel #2
0
        public override void Execute()
        {
            amount = PromptForDepositAmount();

            if (amount != CANCELLED)
            {
                // tek seferde yatirilabilecek miktar
                bool envelopeReceived = depositSlot.IsDepositEnvelopeReceived(amount);

                if (envelopeReceived)
                {
                    UserScreen.DisplayMessageLine("\nAmount: " + amount);
                    UserScreen.DisplayMessageLine("\nPress for 1 to cancel. Press enter for continue.");

                    // yatirmak icin engel yok yatirmak icin onayla
                    if (keypad.GetInput(true) != 1)
                    {
                        Database.Credit(AccountNumber, amount);
                        UserScreen.DisplayMessageLine("\nDeposit operation success");
                        UserScreen.Sleep(4000);
                    }
                    else
                    {
                        UserScreen.DisplayMessageLine("\nOperation cancelled!");
                        UserScreen.Sleep(4000);
                    }
                }
                else
                {
                    UserScreen.DisplayMessageLine(
                        "\nSlot is not enough. Operation cancelled!"
                        );
                    UserScreen.Sleep(4000);
                }
            }
            else
            {
                UserScreen.DisplayMessageLine(
                    "\nCancelling operation..."
                    );
                UserScreen.Sleep(4000);
                UserScreen.Sleep(2000);
            }
        }