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

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

            SendInterBankTransfer(returnTransfer);
        }