private void abrirToolStripButton_Click(object sender, EventArgs e) { var tipoEstabelecimentoControle = new TipoEstabelecimentoControle(); var tiposEstabelecimentos = tipoEstabelecimentoControle.BuscarTipoEstabelecimento(); var F = new Frm_Busca(tiposEstabelecimentos, "Tipo Estabelecimentos"); F.ShowDialog(); if (F.DialogResult == DialogResult.OK) { var tipoEstabelecimento = new Tipo_Estabelecimento(); var controleTipoEstabelecimento = new TipoEstabelecimentoControle(); var id = int.Parse(F.IdSelect); tipoEstabelecimento = controleTipoEstabelecimento.BuscarTipoEstabelecimentoId(id); PreencherFormulario(tipoEstabelecimento); Btn_Editar.Enabled = true; Btn_Excluir.Enabled = true; } }
private void abrirToolStripButton_Click(object sender, EventArgs e) { var controleValoresFixos = new ValoresFixosControle(); var valoresFixos = controleValoresFixos.BuscarDespesasFixas(); var F = new Frm_Busca(valoresFixos, "Valores Fixos"); var M = F.ShowDialog(); if (M == DialogResult.OK) { var idValorFixo = int.Parse(F.IdSelect); var valorFixo = controleValoresFixos.BuscarDespesasFixasId(idValorFixo); PreencherFormulario(valorFixo); Btn_Cancelar.Enabled = false; Btn_Editar.Enabled = true; Btn_Excluir.Enabled = true; Btn_Gravar.Enabled = false; Btn_Novo.Enabled = true; } }