public void EfetuarPagamento(BancoEnum id) { if (PodeEfetuarPagamento(id)) { EfetuaPagamento(); } else { if (next == null) { throw new Exception("banco não cadastrado"); } next.EfetuarPagamento(id); } }
public BancoChain(BancoEnum id) { next = null; identificadorBanco = id; }
private bool PodeEfetuarPagamento(BancoEnum id) { return(identificadorBanco == id); }