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

            bool result = false;

            try
            {
                var _exists = _userService.EmailExists(new UserService.EmailExistsRequest {
                    Body = new UserService.EmailExistsRequestBody {
                        email = context.Request["email"]
                    }
                });
                result = _exists.Body.EmailExistsResult.Data.Status == UserService.ServiceResponseStatus.Yes;

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


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

            bool result = false;

            try
            {
                var _exists = _userService.EmailExists(new UserService.EmailExistsRequest {
                    Body = new UserService.EmailExistsRequestBody {
                        email = context.Request["email"]
                    }
                });
                result = _exists.Body.EmailExistsResult.Data.Status == UserService.ServiceResponseStatus.Yes;

                if (result == true)
                {
                    //Salva no arquivo txt
                    Log.Save("Email já está cadastrado no banco de dados");
                }
            }
            catch
            {
                result = false;
            }

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