private void btn_localizar_Click(object sender, EventArgs e) { frm_consultaCliente f = new frm_consultaCliente(); f.ShowDialog(); if (f.codigo != 0) { String strConexao = @"Data Source = CARLOS\CARLOSBD; Initial Catalog = Concessionaria; Integrated Security = True"; Conexao conexao = new Conexao(strConexao); CadClin dal = new CadClin(conexao); Cliente contato = dal.carregaContato(f.codigo); txt_cpf.Text = contato.Cpf; txt_rg.Text = contato.Rg; txt_tel.Text = contato.Telefone; //sexo e estado civil txt_nome.Text = contato.Nome; txt_cep.Text = contato.Cep; txt_cidade.Text = contato.Cidade; txt_numCasa.Text = contato.Numero; //txt_.Text = contato.Estado; txt_rua.Text = contato.Rua; txt_compCasa.Text = contato.Complemento; txt_banco.Text = contato.Banco; txt_codAgencia.Text = contato.CodAgencia; txt_nomeAgencia.Text = contato.NomeAgencia; txt_contaCorrente.Text = contato.ContaCorrente; this.AlteraBotoes(3); } f.Dispose(); }
private void consultaToolStripMenuItem_Click(object sender, EventArgs e) { frm_consultaCliente fcl = new frm_consultaCliente(); fcl.Show(); }