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); }
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); } }