Exemplo n.º 1
0
        public HttpResponseMessage SignOut()
        {
            HttpRequestHeaders headers = this.Request.Headers;
            UserVM             _userVM = new UserVM();

            try
            {
                if (headers.Contains("header_token"))
                {
                    _userVM.HeaderToken = headers.GetValues("header_token").First();
                }
                if (headers.Contains("user_id"))
                {
                    _userVM.UserID = Convert.ToInt32(headers.GetValues("user_id").First().Replace("\"", ""));
                }

                if (_userVM.HeaderToken != string.Empty || _userVM.UserID != 0)
                {
                    if (_userBLL.SignOut(_userVM))
                    {
                        _strJSONContent.Append("{\"status\":\"Success\"}");
                    }
                    else
                    {
                        _strJSONContent.Append("{\"status\":\"Failed\"}");
                    }
                }
                else
                {
                    _strJSONContent.Append("{\"status\":\"Failed\"}");
                }
            }
            catch (Exception ex)
            {
                _Message = ex.Message;
                _strJSONContent.Append("{\"status\":\"Failed\"}");
            }
            return(Common.ResponseOutput(_strJSONContent));
        }