Ejemplo n.º 1
0
        public void Execute()
        {
            //Initialization();
            ATMScreen.ShowMenu1();

            while (true)
            {
                switch (Utility.GetValidIntInputAmt("your option"))
                {
                case 1:
                    CheckCardNoPassword();

                    _listOfTransactions = new List <Transaction>();

                    while (true)
                    {
                        ATMScreen.ShowMenu2();

                        switch (Utility.GetValidIntInputAmt("your option"))
                        {
                        case (int)SecureMenu.CheckBalance:
                            CheckBalance(selectedAccount);
                            break;

                        case (int)SecureMenu.PlaceDeposit:
                            PlaceDeposit(selectedAccount);
                            break;

                        case (int)SecureMenu.MakeWithdrawal:
                            MakeWithdrawal(selectedAccount);
                            break;

                        case (int)SecureMenu.ThirdPartyTransfer:
                            var vMThirdPartyTransfer = new VMThirdPartyTransfer();
                            vMThirdPartyTransfer = ATMScreen.ThirdPartyTransferForm();

                            PerformThirdPartyTransfer(selectedAccount, vMThirdPartyTransfer);
                            break;

                        case (int)SecureMenu.ViewTransaction:
                            ViewTransaction(selectedAccount);
                            break;

                        case (int)SecureMenu.Logout:
                            Utility.PrintMessage("You have succesfully logout. Please collect your ATM card..", true);

                            Execute();
                            break;

                        default:
                            Utility.PrintMessage("Invalid Option Entered.", false);

                            break;
                        }
                    }

                case 2:
                    Console.Write("\nThank you for using Meybank. Exiting program now .");
                    Utility.printDotAnimation(15);

                    System.Environment.Exit(1);
                    break;

                default:
                    Utility.PrintMessage("Invalid Option Entered.", false);
                    break;
                }
            }
        }
Ejemplo n.º 2
0
        public void Execute()
        {
            ATMScreen.ShowMenu1();
            while (true)
            {
                int inp;
                int.TryParse(Console.ReadLine(), out inp);
                switch (inp)
                {
                case 1:
                    // CheckCardNoPassword();

                    Console.WriteLine("Type pin code");
                    int pin = Convert.ToInt32(Console.ReadLine());
                    if (pin != zaydacc.PinCode)
                    {
                        Console.WriteLine("Invalid input");
                        System.Environment.Exit(1);
                    }



                    while (true)
                    {
                        ATMScreen.ShowMenu2();

                        switch (Utility.GetValidIntInputAmt("your option"))
                        {
                        case (int)SecureMenu.CheckBalance:
                            CheckBalance(zaydacc);
                            break;

                        case (int)SecureMenu.PlaceDeposit:

                            break;

                        case (int)SecureMenu.MakeWithdrawal:

                            break;

                        case (int)SecureMenu.ThirdPartyTransfer:

                            break;

                        case (int)SecureMenu.ViewTransaction:

                            break;

                        case (int)SecureMenu.Logout:
                            Utility.PrintMessage("You have succesfully logout. Please collect your ATM card..", true);

                            Execute();
                            break;

                        default:
                            Utility.PrintMessage("Invalid Option Entered.", false);

                            break;
                        }
                    }

                case 2:
                    Console.Write("\nThank you for using Zaydbank. Exiting program now .");
                    //Utility.printDotAnimation(15);

                    System.Environment.Exit(1);
                    break;

                default:
                    Utility.PrintMessage("Invalid Option Entered.", false);
                    break;
                }
            }
        }