public void Adiciona(ContaC conta) { if(this.quantidade >= 9) { throw new Exception("Quantidade de contas superadas"); } this.Contas[this.quantidade] = conta; this.quantidade++; }
private void Form1_Load(object sender, EventArgs e) { ClienteC titular = new ClienteC("Cristina", 19) { Rg = "10.100.100-9", Cpf = "270.444.239-99" }; this.conta = new ContaPoupanca(titular); this.conta.Numero = 1; this.conta.Agencia = 12; this.MostraConta(); this.contasCadastro = new ContaC[4]; ClienteC t1 = new ClienteC("Gabriel", 14); this.contasCadastro[0] = new ContaCorrente(t1); ClienteC t2 = new ClienteC("Caroline", 8); this.contasCadastro[1] = new ContaPoupanca(t2); ClienteC t3 = new ClienteC("Letícia", 10); this.contasCadastro[2] = new ContaPoupanca(t3); ClienteC t4 = new ClienteC("Lucien", 37); this.contasCadastro[3] = new ContaCorrente(t4); for (int i=0; i < this.contasCadastro.Length; i++) { comboDestinos.Items.Add("Titualr: " + this.contasCadastro[i].Titular.Nome); } }
public void Adiciona(ContaC conta) { this.Total += conta.Saldo; }
public void Transfere(double valor, ContaC destino) { Saque(valor); destino.Deposita(valor); }
private void comboDestinos_SelectedIndexChanged(object sender, EventArgs e) { int indiceSelecionado = comboDestinos.SelectedIndex; this.destino = this.contasCadastro[indiceSelecionado]; textDestinoNumero.Text = Convert.ToString(this.destino.Numero); }