Пример #1
0
        static void Main(string[] args)
        {
            var account = new Account();

            var command = new Command {
                Amount = 100, TheAction = Action.Deposit
            };

            account.Process(command);

            WriteLine(account);

            command = new Command {
                Amount = 50, TheAction = Action.Withdraw
            };
            account.Process(command);

            WriteLine(account);

            command = new Command {
                Amount = 150, TheAction = Action.Withdraw
            };
            account.Process(command);

            WriteLine(account);

            ReadLine();
        }
        static void Main(string[] args)
        {
            Account ac = new Account();

            Command command = new Command();

            command.Amount    = 100;
            command.TheAction = Command.Action.Deposit;

            ac.Process(command);

            command.TheAction = Command.Action.Withdraw;
            ac.Process(command);

            WriteLine(ac);
        }