private void TestarValidarCPFValidos()
 {
     if (!(TipoCPF.ValidarCPF("63777912913") && TipoCPF.ValidarCPF("36647724826")))
     {
         TesteOK = false;
     }
 }
Exemple #2
0
        public bool validaCPF(string cpf)
        {
            this.erros.classe = "Funcoes";
            this.erros.funcao = "validaCPF()";
            TipoCPF tipoCPF = new TipoCPF();
            bool    result;

            try
            {
                tipoCPF.setString = cpf;
                if (!tipoCPF.isOk())
                {
                    this.erros.descErro = "CPF INVALIDADO...";
                    result = false;
                }
                else
                {
                    result = true;
                }
            }
            catch (Exception ex)
            {
                this.erros.codErro  = "9999";
                this.erros.descErro = "EXCEPTION (VALIDA CPF). Msg.: " + ex.Message;
                result = false;
            }
            return(result);
        }
Exemple #3
0
 public void SetCPF(string cpf)
 {
     if (TipoCPF.ValidarCPF(cpf))
     {
         this.CPF = new TipoCPF(cpf);
     }
     else
     {
         throw new ArgumentException(cpf + " não é um cpf válido.");
     }
 }