예제 #1
0
        //PESQUISAR
        public static List <MPessoa> Pesquisar(MPessoa item)
        {
            List <MPessoa> retorno = null;

            if (item != null && item.Nome != null && item.Nome.Length <= 200)
            {
                string cpf = item.CPF.Replace(".", "");
                cpf = cpf.Replace("-", "");
                cpf = cpf.Trim();

                if (cpf == "")
                {
                    item.CPF = "";
                }

                retorno = DPessoa.Pesquisar(item);

                //RETORNO SE NÃO HOUVER NENHUM CADASTRO
                if (retorno == null)
                {
                    throw new Exception("A Pesquisa não retornou nenhum cadastro!");
                }
            }
            return(retorno);
        }
예제 #2
0
        public static List <MPessoa> Pesquisar(MPessoa item)
        {
            List <MPessoa> retorno = null;

            if (item != null && item.Nome != null && item.Nome.Length <= 200)
            {
                string cpf = item.CPF.Replace(".", "");
                cpf = cpf.Replace("-", "");
                cpf = cpf.Trim();

                if (cpf == "")
                {
                    item.CPF = "";
                }

                retorno = DPessoa.Pesquisar(item);
            }
            retorno = DPessoa.Pesquisar(item);

            return(retorno);
        }