Exemplo n.º 1
0
        private void btnPesquisaCPF_Click(object sender, EventArgs e)
        {
            cmbNomeCliente.Items.Clear();
            Cliente novo = new Cliente();

            if (critica.VerificaNum_Ponto_Traco(txtCPF.Text))
            {
                listaCliente = novo.BuscaClientesCPFBanco(txtCPF.Text);
                if (listaCliente.Count() == 0)
                {
                    MessageBox.Show("Cliente inexistente!");
                }
                else
                {
                    lblNome.Text       = listaCliente[0].Nome.ToString();
                    lblData.Text       = listaCliente[0].DataNascimento.ToString().Substring(0, 10);
                    lblCPF.Text        = listaCliente[0].CPF.ToString();
                    lblEmail.Text      = listaCliente[0].Email.ToString();
                    lblTelCelular.Text = listaCliente[0].TelCelular.ToString();
                    novo2 = listaCliente[0];
                }
            }
            else
            {
                MessageBox.Show("Formato de cpf inválido");
            }
        }
Exemplo n.º 2
0
        private void btnPesquisaCPF_Click(object sender, EventArgs e)
        {
            cmbNomeCliente.Items.Clear();
            Cliente novo = new Cliente();

            if (critica.VerificaNum_Ponto_Traco(txtCPF.Text))
            {
                listaCliente = novo.BuscaClientesCPFBanco(txtCPF.Text);
                if (listaCliente.Count() == 0)
                {
                    MessageBox.Show("Cliente inexistente!");
                }
                else
                {
                    for (int i = 0; i < listaCliente.Count; i++)
                    {
                        cmbNomeCliente.Items.Add(listaCliente[i].Nome.ToString());
                    }
                }
            }
            else
            {
                MessageBox.Show("Formato de cpf inválido");
            }
        }
Exemplo n.º 3
0
        //Método que atualiza os dados de cadastro
        public bool AlteraAtributo(string Nome_, string CPF_, DateTime DataNascimento_,
                                   string Email_, string TelCelular_)
        {
            CriticaDados novo    = new CriticaDados();
            bool         retorno = true;

            if (novo.VerificaLetra_Ponto_Traco(Nome_))
            {
                Nome = Nome_;
            }

            else
            {
                retorno = false;
            }

            if (novo.VerificaNum_Ponto_Traco(CPF_))
            {
                CPF = CPF_;
            }
            else
            {
                retorno = false;
            }

            DataNascimento = DataNascimento_;

            if (novo.VerificaLetra_Ponto_Arroba(Email_))
            {
                Email = Email_;
            }
            else
            {
                retorno = false;
            }

            if (novo.VerificaNum_Parenteses_Traco(TelCelular_))
            {
                TelCelular = TelCelular_;
            }
            else
            {
                retorno = false;
            }

            return(retorno);
        }