private void CarregarCadastro(GerenciadorFormulario gerenciador) { _gerenciador = gerenciador; lblTipoCadastro.Text = _gerenciador.ObtemTipoCadastro(); UserControl listagem = _gerenciador.CarregarListagem(); listagem.Dock = DockStyle.Fill; panelControl.Controls.Clear(); panelControl.Controls.Add(listagem); EstadoBotoes estado = _gerenciador._estadoBotoes(); btnCadastrarConta.Enabled = estado.Cadastrar;//enable para habilitar ou desabilitar btnExcluir.Enabled = estado.Excluir; btnExtrato.Enabled = estado.ExibirExtrato; btnRealizarSaque.Enabled = estado.RealizarSaque; btnRealizarDeposito.Enabled = estado.RealizarDeposito; btnTransferencia.Enabled = estado.Transferencia; TrocarNomeBotoes troca = _gerenciador._nomeBotoes(); btnCadastrarConta.Text = troca.Cadastrar;//enable para habilitar ou desabilitar btnExcluir.Text = troca.Excluir; btnExtrato.Text = troca.ExibirExtrato; btnRealizarSaque.Text = troca.RealizarSaque; btnRealizarDeposito.Text = troca.RealizarDeposito; btnTransferencia.Text = troca.Transferencia; }
public override EstadoBotoes _estadoBotoes() { EstadoBotoes estado = new EstadoBotoes(); estado.Cadastrar = true; estado.Excluir = true; estado.ExibirExtrato = false; estado.RealizarDeposito = false; estado.RealizarSaque = false; estado.Transferencia = false; return(estado); }
private void CarregarCadastro(IGerenciadorFormulario gerenciador, string selecionado) { _gerenciador = gerenciador; UserControl listagem = _gerenciador.PegarControle(); _gerenciador.CarregarListagem(); EstadoBotoes estadoBotoes = _gerenciador.ObtemEstadoBotoes(); TituloBotoes tituloBotoes = _gerenciador.ObtemTituloBotoes(selecionado); ModificarEstadoBotoes(estadoBotoes); ModificarTituloBotoes(tituloBotoes); listagem.Dock = DockStyle.Fill; panelControl.Controls.Clear(); _gerenciador.LimparItemSelecionado(); panelControl.Controls.Add(listagem); }
private void CarregarCadastro(GerenciadorFormulario gerenciador) { _gerenciador = gerenciador; EstadoBotoes _gerenciadorTipoBotao = gerenciador.ObtemTipoBotoes(); tsLabel.Text = _gerenciador.ObtemTipoCadastro(); btnCadastrar.Enabled = _gerenciadorTipoBotao.Cadastrar; btnDepositar.Enabled = _gerenciadorTipoBotao.Depositar; btnSaque.Enabled = _gerenciadorTipoBotao.Sacar; btnTransferir.Enabled = _gerenciadorTipoBotao.Transferir; btnExtrato.Enabled = _gerenciadorTipoBotao.Extrato; btnExcluir.Enabled = _gerenciadorTipoBotao.Excluir; UserControl listagem = _gerenciador.CarregarListagem(); listagem.Dock = DockStyle.Fill; panelControl.Controls.Clear(); panelControl.Controls.Add(listagem); }
private void ModificarEstadoBotoes(EstadoBotoes estadoBotoes) { ToolStripbtnGravar.Enabled = estadoBotoes.Gravar; ToolStripbtnEditar.Enabled = estadoBotoes.Editar; ToolStripbtnExcluir.Enabled = estadoBotoes.Excluir; }