Esempio n. 1
0
        private void CarregaCep()
        {
            if (Convert.ToInt32(LogradouroText.Tag.ToString()) == 0)
            {
                LogradouroText.Tag = "0";
            }

            if (UFList.SelectedValue.ToString() == "SP" && Convert.ToInt32(CidadeList.SelectedValue) == 413)
            {
                Endereco_bll clsEndereco = new Endereco_bll(_connection);
                int          nCep        = clsEndereco.RetornaCep(Convert.ToInt32(LogradouroText.Tag.ToString()), NumeroList.Text == ""?(short)0:  Convert.ToInt16(NumeroList.Text));
                CepMask.Text = nCep.ToString("00000-000");
            }
        }
Esempio n. 2
0
        private void CarregaCep()
        {
            if (Convert.ToInt32(LogradouroText.Tag.ToString()) == 0)
            {
                LogradouroText.Tag = "0";
            }

            if (UFList.SelectedValue.ToString() == "SP" && Convert.ToInt32(CidadeList.SelectedValue) == 413)
            {
                Endereco_bll enderecoRepository = new Endereco_bll(_connection);
                int          nCep = enderecoRepository.RetornaCep(Convert.ToInt32(LogradouroText.Tag.ToString()), NumeroList.Text == ""?(short)0:  Convert.ToInt16(NumeroList.Text));
                CepMask.Text = nCep.ToString("00000-000");

                short _num = 0;
                if (gtiCore.IsNumeric(NumeroList.Text))
                {
                    _num = Convert.ToInt16(NumeroList.Text);
                }
                GTI_Models.Models.Bairro _bairro = enderecoRepository.RetornaLogradouroBairro(Convert.ToInt32(LogradouroText.Tag.ToString()), _num);
                BairroText.Text = _bairro.Descbairro;
                BairroText.Tag  = _bairro.Codbairro.ToString();
            }
        }