public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "application/json";

            bool result = false;

            try
            {
                var _exists = _userService.DocumentExists(new UserService.DocumentExistsRequest {
                    Body = new UserService.DocumentExistsRequestBody {
                        documentId = context.Request["documentId"]
                    }
                });
                result = _exists.Body.DocumentExistsResult.Data.Status == UserService.ServiceResponseStatus.Yes;

                if (result)
                {
                    Log.Warn("CPF já existe na base");
                }
            }
            catch
            {
                result = false;
            }

            context.Response.Write(JsonConvert.SerializeObject(new { status = result }));
        }
Example #2
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "application/json";

            bool result = false;

            try
            {
                var _exists = _userService.DocumentExists(new UserService.DocumentExistsRequest {
                    Body = new UserService.DocumentExistsRequestBody {
                        documentId = context.Request["documentId"]
                    }
                });
                result = _exists.Body.DocumentExistsResult.Data.Status == UserService.ServiceResponseStatus.Yes;
                if (result)
                {                //Salva no arquivo txt
                    Log.Save("Documento já está cadastrado no banco de dados");
                }
            }
            catch
            {
                result = false;
            }

            context.Response.Write(JsonConvert.SerializeObject(new { status = result }));
        }