コード例 #1
0
        public PINMenu(Terminal terminal, CommandFactory fact)
        {
            Text = "Current balance: " + terminal.user.Balance + "\n" +
                   "====================\n" +
                   "Press [C) to change PIN;\n" +
                   "Press [B) to return to Main Menu\n" +
                   "====================\n\n";
            otherOptions.Add("C", new MenuOption("(C) - Change PIN", (ChangePINCommand)fact.CreateCommand(COMMAND.CHANGE_PIN)));
            BackCommand backCommand = (BackCommand)fact.CreateCommand(COMMAND.BACK);

            backCommand.PreviousMenuCreator = new MainMenuCreator();
            otherOptions.Add("B", new MenuOption("(B) - Back", backCommand));
        }
コード例 #2
0
        public SumMenu(Terminal terminal, CommandFactory factory)
        {
            Text = "Current balance: " + terminal.user.Balance + "\n" +
                   "====================\n" +
                   "Press [E) to choose sum;\n" +
                   "Press [B) to return to Main Menu\n" +
                   "====================\n\n";

            otherOptions.Add("E", new MenuOption("(E) - Enter sum", (ChooseSumCommand)factory.CreateCommand(COMMAND.CHOOSE_SUM)));

            BackCommand backCommand = (BackCommand)factory.CreateCommand(COMMAND.BACK);

            backCommand.PreviousMenuCreator = new MainMenuCreator();
            otherOptions.Add("B", new MenuOption("(B) - Back", backCommand));
        }
コード例 #3
0
        public WithdrawMenu(Terminal terminal, CommandFactory factory)
        {
            Text = "Current balance: " + terminal.user.Balance + "\n" +
                   "====================\n" +
                   "Press [1)-[9) to remove banknote;\n" +
                   "Press [W) to withdraw money;\n" +
                   "Press [B) to return to Main Menu\n" +
                   "====================\n\n";

            SetPage(0, terminal, factory);
            otherOptions.Add("P", new MenuOption("(P) - Prev", (PreviousCommand)factory.CreateCommand(COMMAND.PREVIOUS)));
            otherOptions.Add("N", new MenuOption("(N) - Next", (NextCommand)factory.CreateCommand(COMMAND.NEXT)));
            otherOptions.Add("W", new MenuOption("(W) - Withdraw", (WithdrawCommand)factory.CreateCommand(COMMAND.WITHDRAW)));
            BackCommand backCommand = (BackCommand)factory.CreateCommand(COMMAND.BACK);

            backCommand.PreviousMenuCreator = new MainMenuCreator();
            otherOptions.Add("B", new MenuOption("(B) - Back", backCommand));
        }