예제 #1
0
 public SendMoney(BankSystem system, BankAccount sender, BankAccount recipent, double saldo)
 {
     _system   = system;
     _sender   = sender;
     _recipent = recipent;
     _saldo    = saldo;
 }
예제 #2
0
        static void Main(string[] args)
        {
            BankSystem  system = new BankSystem();
            BankAccount acc1   = new BankAccount()
            {
                ID = 1, Number = 1000, Saldo = 11111
            };
            BankAccount acc2 = new BankAccount()
            {
                ID = 2, Number = 2000, Saldo = 22222
            };
            BankAccount acc3 = new BankAccount()
            {
                ID = 3, Number = 3000, Saldo = 1000
            };

            BankQueue.GetInstance().AddTransactions(new SendMoney(system, acc1, acc2, 15.20));
            BankQueue.GetInstance().AddTransactions(new SendMoney(system, acc3, acc2, 0.20));
            BankQueue.GetInstance().DoAllTransactions();
        }