Exemple #1
0
 //Create user button
 private void ButtonCreateUser_Click(object sender, RoutedEventArgs e)
 {
     if (CheckInput())
     {
         if (CheckForDuplicate())
         {
             NewUser();
             TextBoxName.Clear();
             TextBoxEmail.Clear();
         }
     }
     ListBoxUsers.UnselectAll();
     ListBoxAdmins.UnselectAll();
     ButtonsDisabled();
 }
Exemple #2
0
 //Updates when admin listbox has changed
 private void ListBoxAdmins_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     ButtonDemoteAdmin.IsEnabled    = true;
     ButtonDeleteUser.IsEnabled     = true;
     ButtonChangeUserInfo.IsEnabled = true;
     if ((User)ListBoxAdmins.SelectedItem != null)
     {
         ListBoxUsers.UnselectAll();
         LabelShowUserInfo.Content = "Admin: " + ((User)ListBoxAdmins.SelectedItem).Name +
                                     "\nEmail Adress: " + ((User)ListBoxAdmins.SelectedItem).Email;
     }
     else
     {
         LabelShowUserInfo.Content = string.Empty;
     }
 }