public IHttpActionResult DeleteUser(string Id) { if (q.DeleteUser(Id)) { return(Ok("User deleted!")); } return(BadRequest("Failed to delete")); }
private void btnRemoveUser_Click(object sender, RoutedEventArgs e) { MessageBoxResult reuslt = MessageBox.Show("Are you sure you want to delete this user?", "Question", MessageBoxButton.YesNo, MessageBoxImage.Question); if (reuslt == MessageBoxResult.Yes) { Button button = sender as Button; if (AdminQuery.DeleteUser(int.Parse(button.Uid))) { MessageBox.Show("You successfully deleted user!", "Information", MessageBoxButton.OK, MessageBoxImage.Information); } this.usersContainer.Children.Clear(); this.LoadUsers(); } }