Beispiel #1
0
        public static string VerificaCPFCadastrado(string pCPF)
        {
            string retorno = string.Empty;

            List <Cliente> clientes = new BoCliente().PesquisaCPF(pCPF);

            if (clientes.Count() > 0)
            {
                retorno = "CPF já existente !";
            }

            return(retorno);
        }
        public JsonResult ListarBeneficiarios(string id)
        {
            List <ClienteBeneficiario> clientes = new BoCliente().ListarBeneficiarios();

            clientes.RemoveAll(Id => Id == null);
            clientes.RemoveAll(IdCliente => IdCliente == null);
            List <Row> teste = new List <Row>();


            for (int i = 0; i < clientes.Count(); i++)
            {
                teste.Add(new Row()
                {
                    CPF  = clientes[i].CPF,
                    Nome = clientes[i].Nome,
                });
            }
            RootObject Escopo = new RootObject()
            {
                rowCount = clientes.Count(), rows = teste, current = clientes.Count(), total = clientes.Count()
            };

            return(Json(Escopo, JsonRequestBehavior.AllowGet));
        }