Exemplo n.º 1
0
        private void preencheDados()
        {
            LabCod0.Text     = Convert.ToString(clienteSelecionado.getCod());
            txtNome.Text     = clienteSelecionado.getNome();
            txtEndereco.Text = clienteSelecionado.getEnd();

            String doc = clienteSelecionado.getCPFCNPJ();

            doc = doc.Replace(".", "");
            doc = doc.Replace("-", "");
            doc = doc.Replace("/", "");

            txtCNPJ.Text = doc;

            TxtInsc.Text   = clienteSelecionado.getIE();
            TxtBairro.Text = clienteSelecionado.getBairro();
            TxtCEP.Text    = clienteSelecionado.getCEP();
            //Tratamento para não encontrar UF na lista
            String UF = clienteSelecionado.getUF().ToUpper().Trim();

            if (TxtUF.Items.Contains(new ListItem()
            {
                Text = UF
            }))
            {
                TxtUF.Text = clienteSelecionado.getUF().ToUpper().Trim();
                new Uteis().listaCidades(TxtUF.Text, TxtCidade);
                if (TxtCidade.Items.Contains(new ListItem()
                {
                    Value = clienteSelecionado.getCidade(), Text = clienteSelecionado.getCidade()
                }))
                {
                    TxtCidade.Text = clienteSelecionado.getCidade();
                }
                Limite         = Convert.ToString(clienteSelecionado.getLimite());
                labLimite.Text = "Limite: R$ " + Limite;
            }
            else
            {
                TxtUF.Text     = "";
                TxtCidade.Text = "";
            }

            TxtNascimento.Text = Convert.ToString(clienteSelecionado.getDataNascimento(), culture).Replace("00:00:00", "");
            TxtCadastro.Text   = Convert.ToString(clienteSelecionado.getDataCadastro(), culture).Replace("00:00:00", "");
            TxtReferencia.Text = clienteSelecionado.getReferencia();
            TxtTelefone.Text   = clienteSelecionado.getTelefone();
            String opCliente = clienteSelecionado.getOperadora().ToUpper();

            if (opCliente == "OI" || opCliente == "TIM" || opCliente == "CLARO" || opCliente == "VIVO")
            {
                CobOperadora.Text = clienteSelecionado.getOperadora().ToUpper();
            }
            txtEmail.Text   = clienteSelecionado.getEmail();
            txtPai.Text     = clienteSelecionado.getPai();
            TxtMae.Text     = clienteSelecionado.getMae();
            TxtEndPais.Text = clienteSelecionado.getEndPais();
            ativaFiliacao(!clienteSelecionado.getPessoaJuridica()); // Deve-se colocar invertido pois o mesmo metódo é que verifica qual status anterior.
            ativaMascara();
            this.labCapital.Text = new UteisWeb().montaTab(clienteSelecionado.getInformacoesdeCredito(), "Informações financeira", System.Drawing.Color.AliceBlue);
        }