public decimal capitalize(CAccount acc) { decimal temp = acc.GetSaldo(); temp += temp * this.interest; return(temp); }
public WithDraw(decimal amount, CAccount acc) { this.operationType = "WITHDRAW"; this.amount = amount; this.sourceID = acc.GetAccID(); this.destinationID = -1; }
public void execute(CAccount from) { if (from.substrMoney(amount)) { dest.addMoney(amount); } }
public PayIn(decimal amount, CAccount dest) { this.operationType = "PAYIN"; this.amount = amount; this.destinationID = dest.GetAccID(); this.sourceID = -1; }
public void PayIn(CAccount acc, decimal amount) { PayIn payin = new PayIn(amount, acc); IOperation oper = payin; acc.DoOperation(oper); acc.GetHistory().AddToHistory(payin); }
public Transfer(CAccount to, decimal amount, CAccount from) { this.operationType = "TRANSFER"; this.amount = amount; this.dest = to; this.destinationID = to.GetAccID(); this.sourceID = from.GetAccID(); }
public void StoreAccount(int id, int ownerID) { CAccount acc = new CAccount(id, ownerID); this.accounts.Add(acc); CCustomer c = GetCustomer(ownerID); c.AddAccount(acc); }
public Transfer Transfer(CAccount from, CAccount to, decimal amount) { Transfer transfer = new Transfer(to, amount, from); IOperation oper = transfer; from.DoOperation(oper); from.GetHistory().AddToHistory(transfer); // to.GetHistory().AddToHistory(transfer); return(transfer); }
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); } }
public void execute(CAccount acc) { acc.substrMoney(amount); }
public void AddAccount(CAccount acc) { accounts.Add(acc); }
public void execute(CAccount acc) { acc.addMoney(amount); date = DateTime.Now; }