예제 #1
0
 public IHttpActionResult DeleteUser(int id)
 {
     try
     {
         if (HttpContext.Current.User.Identity.IsAuthenticated)
         {
             var userDeleted = _userDetailContext.GetUserById(id);
             var user        = UserManager.FindById(userDeleted.UserId);
             var status      = _userDetailContext.CheckUserDeletable(id);
             if (status == 1)
             {
                 UserManager.Delete(user);
                 _userDetailContext.DeleteUserDetail(id);
                 status = 1;
             }
             return(Ok(new { status = status }));
         }
         else
         {
             return(BadRequest());
         }
     }
     catch (Exception ex)
     {
         _errorLog.LogException(ex);
         throw;
     }
 }