Example #1
0
        private bool DisplayMenu()
        {
            UserScreen.Clear();
            UserScreen.DisplayMessageLine("\nWithdrawal menu\n");
            UserScreen.DisplayMessageLine("1->\t$10");
            UserScreen.DisplayMessageLine("2->\t$20");
            UserScreen.DisplayMessageLine("3->\t$50");
            UserScreen.DisplayMessageLine("4->\t$100");
            UserScreen.DisplayMessageLine("5->\t$200");
            UserScreen.DisplayMessageLine("6->\t$500");
            UserScreen.DisplayMessageLine("7->\t2000");
            UserScreen.DisplayMessageLine("8->\tOther");
            UserScreen.DisplayMessageLine("9->\tCancel transaction");
            UserScreen.DisplayMessage("\nChoose a with drawal amount: ");

            switch (keypad.GetInput())
            {
            case (int)Menu.AMOUNT10: return(IsWithrawal(10));

            case (int)Menu.AMOUNT20: return(IsWithrawal(20));

            case (int)Menu.AMOUNT50: return(IsWithrawal(50));

            case (int)Menu.AMOUNT100: return(IsWithrawal(100));

            case (int)Menu.AMOUNT200: return(IsWithrawal(200));

            case (int)Menu.AMOUNT500: return(IsWithrawal(500));

            case (int)Menu.AMOUNT2000: return(IsWithrawal(2000));

            case (int)Menu.OTHER:
                UserScreen.DisplayMessage("\nEnter a value: ");
                return(IsWithrawal(keypad.GetInput()));

            case (int)Menu.GO_BACK:
                return(false);

            default:
                UserScreen.DisplayMessageLine("\nInvalid selection! Try again.");
                break;
            }
            return(false);
        }