Esempio n. 1
0
        private void MskTxtBox_CEP_Leave(object sender, EventArgs e)
        {
            string vCep = MskTxtBox_CEP.Text.Replace("-", "");

            if (vCep != "")
            {
                if (vCep.Length == 8)
                {
                    if (Information.IsNumeric(vCep))
                    {
                        var      vJson = Uteis.GeraJSONCEP(vCep);
                        Cep.Unit CEP   = new Cep.Unit();
                        CEP = Cep.DesSerializedClassUnit(vJson);

                        TxtBox_Logradouro.Text = CEP.logradouro;
                        TxtBox_Bairro.Text     = CEP.bairro;
                        TxtBox_Cidade.Text     = CEP.localidade;

                        CmbBox_UF.SelectedItem = CEP.uf;
                    }
                }
            }
        }