コード例 #1
0
ファイル: FormCliente.cs プロジェクト: anacecilian/Atelie
        private void btnPesquisarEnd_Click(object sender, EventArgs e)
        {
            string   cep = txtCEPNum.Text;
            Endereco end = enderecoServico.PesquisaPorCEP(cep);

            if (end.Id > 0)
            {
                txtLogradouro.Text        = end.Logradouro;
                txtBairro.Text            = end.Bairro;
                txtCEPNum.Enabled         =
                    txtLogradouro.Enabled =
                        txtBairro.Enabled = false;
            }
            else
            {
                txtLogradouro.Text    =
                    txtBairro.Text    = string.Empty;
                txtCEPNum.Enabled     = false;
                txtLogradouro.Enabled =
                    txtBairro.Enabled = true;
            }
        }