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

            senderAccount.Withdraw(interBankTransfer.getAmount());
            InterBankOfBank.SendInterBankTransfer(interBankTransfer);
        }
Esempio n. 2
0
File: Bank.cs Progetto: 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);
            }
        }
Esempio n. 3
0
        public void SendBackInterBankTransfer(InterBankTransfer interBankTransfer)
        {
            var returnTransfer = new InterBankTransfer(interBankTransfer.getReceiverBank(), interBankTransfer.getReceiverID(),
                                                       interBankTransfer.getSenderBank(), interBankTransfer.getSenderID(), interBankTransfer.getAmount());

            SendInterBankTransfer(returnTransfer);
        }