Example #1
0
        private void btnMakeAdmin_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult reuslt = MessageBox.Show("Are you sure you want to make these users admins?", "Question", MessageBoxButton.YesNo, MessageBoxImage.Question);

            if (reuslt == MessageBoxResult.Yes)
            {
                foreach (var user in this.usersToChange)
                {
                    if (AdminQuery.MakeAdmin(user))
                    {
                        MessageBox.Show("You successfully make the user admin.", "Information", MessageBoxButton.OK, MessageBoxImage.Information);
                    }

                    this.usersContainer.Children.Clear();
                    this.LoadUsers();
                }

                this.usersToChange.Clear();
            }
        }