private void btLocalizar_Click(object sender, EventArgs e) { frmConsultaFornecedor f = new frmConsultaFornecedor(); // obj para gravar os dados no banco DALConexao cx = new DALConexao(DadosDaConexao.StringDeConexao); BLLFornecedor bll = new BLLFornecedor(cx); //exibe o frmConsultaCategoria para seleção da alteração f.ShowDialog(); //verifica se foi armazenado uma categoria no frmConsultaCategoria if (f.codigo != 0) { ModeloFornecedor modelo = bll.CarregarModeloFornecedor(f.codigo); txtCodigo.Text = modelo.ForCod.ToString(); txtNome.Text = modelo.ForNome; txtRazaoSocial.Text = modelo.ForRsocial; txtCpfCnpj.Text = modelo.ForCnpj; txtRgIe.Text = modelo.ForIe; txtEmail.Text = modelo.ForEmail; txtTel.Text = modelo.ForFone; txtCel.Text = modelo.ForCel; txtCep.Text = modelo.ForCep; txtBairro.Text = modelo.ForBairro; txtEnd.Text = modelo.ForEndereco; txtEndNumero.Text = modelo.ForEndNumero; txtCidade.Text = modelo.ForCidade; txtEstado.Text = modelo.ForEstado; alteraBotoes(3); } else { this.limpaTela(); this.alteraBotoes(1); } f.Dispose(); }