Exemplo n.º 1
0
        public bool WithDraw(CBank bank, CAccount acc, decimal amount)
        {
            bool       positive = false;
            WithDraw   withdraw = new WithDraw(amount, acc);
            IOperation oper     = withdraw;

            if (acc.GetSaldo() >= amount)
            {
                acc.DoOperation(oper);
                acc.GetHistory().AddToHistory(withdraw);
                positive = true;
            }
            return(positive);
        }
Exemplo n.º 2
0
        public bool WithDraw(CBank bank, CAccount acc, decimal amount)
        {
            if (this.bank.WithDraw(bank, acc, amount))
            {
                return(true);
            }
            else
            {
                WithDraw   withdraw = new WithDraw(amount, acc);
                IOperation oper     = withdraw;

                acc.DoOperation(oper);
                acc.GetHistory().AddToHistory(withdraw);
                return(true);
            }
        }
Exemplo n.º 3
0
 public CKIRProxy(CBank bu, IKIRMediator ku)
 {
     this.bankUtility   = bu;
     this.kirUtility    = ku;
     this.kirOperations = new List <COperation>();
 }