Example #1
0
 public IHttpActionResult DeleteUser(string Id)
 {
     if (q.DeleteUser(Id))
     {
         return(Ok("User deleted!"));
     }
     return(BadRequest("Failed to delete"));
 }
Example #2
0
        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();
            }
        }