コード例 #1
0
        private void txtCepCli_ButtonClick_1(object sender, EventArgs e)
        {
            Validacoes v = new Validacoes();

            string cep = v.procuraCEP(txtCepCli.getText);

            if (cep != "")
            {
                string[] x = cep.Split(';');

                txtMunicipioCli.Text = x[0];
                cmbUfCli.Text        = x[1];
                txtBairroCli.Text    = x[2];
                txtEndCli.Text       = x[3];

                if (!String.IsNullOrEmpty(txtEndCli.Text))
                {
                    txtEndCli.Focus();
                }
                else
                {
                    txtNumCli.Focus();
                }
            }
            else
            {
                MessageBox.Show("CEP não encontrado.", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtEndCli.Focus();
            }
        }
コード例 #2
0
        private void txtCepTrans_ButtonClick_1(object sender, EventArgs e)
        {
            string cep = valida.procuraCEP(txtCepTrans.getText);

            if (cep != "")
            {
                string[] x = cep.Split(';');

                txtMunicipiotrans.Text = x[0];
                uFComboBox.Text        = x[1];
                txtBairrotrans.Text    = x[2];
                txtEndtrans.Text       = x[3];

                NumTrans.Focus();
            }
            else
            {
                MessageBox.Show("CEP não encontrado.", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtEndtrans.Focus();
            }
        }
コード例 #3
0
        private void txtcep_ButtonClick(object sender, EventArgs e)
        {
            Validacoes v = new Validacoes();

            string cep = v.procuraCEP(txtcep.getText);

            if (cep != "")
            {
                string[] x = cep.Split(';');

                txtMunicipio.Text = x[0];
                cmbUfCli.Text     = x[1];
                txtBairro.Text    = x[2];
                txtEndereco.Text  = x[3];

                txtnum.Focus();
            }
            else
            {
                MessageBox.Show("CEP não encontrado.", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtEndereco.Focus();
            }
        }
コード例 #4
0
        private void txtCepCli_ButtonClick_1(object sender, EventArgs e)
        {
            Validacoes v = new Validacoes();

            string cep = v.procuraCEP(txtCepCli.getText);

            if (cep != "")
            {
                string[] x = cep.Split(';');

                txtMunicipioCli.Text = x[0];
                cmbUfCli.Text = x[1];
                txtBairroCli.Text = x[2];
                txtEndCli.Text = x[3];

                if (!String.IsNullOrEmpty(txtEndCli.Text))
                    txtEndCli.Focus();
                else
                    txtNumCli.Focus();
            }
            else
            {
                MessageBox.Show("CEP não encontrado.", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtEndCli.Focus();
            }
        }