Exemplo n.º 1
0
Arquivo: Bank.cs Projeto: lukeses/bank
        public void sendInterBankTransfer(InterBankTransfer interBankTransfer)
        {
            var senderAccount = this.AccountList.Find(b => b.ID == interBankTransfer.getSenderID());

            senderAccount.Withdraw(interBankTransfer.getAmount());
            InterBankOfBank.SendInterBankTransfer(interBankTransfer);
        }
Exemplo n.º 2
0
Arquivo: Bank.cs Projeto: lukeses/bank
        public void receiveInterBankTransfer(InterBankTransfer interBankTransfer)
        {
            var receiverAccount = this.AccountList.Find(b => b.ID == interBankTransfer.getReceiverID());

            if (receiverAccount != null)
            {
                receiverAccount.Deposit(interBankTransfer.getAmount());
            }
            else
            {
                InterBankOfBank.SendBackInterBankTransfer(interBankTransfer);
            }
        }
Exemplo n.º 3
0
        public void SendBackInterBankTransfer(InterBankTransfer interBankTransfer)
        {
            var returnTransfer = new InterBankTransfer(interBankTransfer.getReceiverBank(), interBankTransfer.getReceiverID(),
                                                       interBankTransfer.getSenderBank(), interBankTransfer.getSenderID(), interBankTransfer.getAmount());

            SendInterBankTransfer(returnTransfer);
        }