Exemplo n.º 1
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            c.Nome = null;

            c.Telefone = txtBuscTel.Text;
            Cliente newC = pDAO.BuscarContato(c);

            if (newC.Nome != null)
            {
                txtNome.Text        = newC.Nome;
                txtEndereco.Text    = newC.Rua;
                txtBairro.Text      = newC.Bairro;
                txtCidade.Text      = newC.Cidade;
                txtComplemento.Text = newC.Complemento;
                txtNumero.Text      = newC.Numero.ToString();
                cbbUF.Text          = newC.Uf;
                c = newC;
            }
            else
            {
                MessageBox.Show("Cliente não encontrado");
                txtNome.Text        = "";
                txtEndereco.Text    = "";
                txtBairro.Text      = "";
                txtCidade.Text      = "";
                txtComplemento.Text = "";
                txtNumero.Text      = "";
                cbbUF.Text          = "";
            }
        }