예제 #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();
 }
예제 #2
0
 //Updates when user listbox selection has changed
 private void ListBoxUsers_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     ButtonDeleteUser.IsEnabled     = true;
     ButtonChangeUserInfo.IsEnabled = true;
     ButtonMakeAdmin.IsEnabled      = true;
     if ((User)ListBoxUsers.SelectedItem != null)
     {
         ListBoxAdmins.UnselectAll();
         LabelShowUserInfo.Content = "Username: "******"\nEmail Adress: " + ((User)ListBoxUsers.SelectedItem).Email;
     }
     else
     {
         LabelShowUserInfo.Content = string.Empty;
     }
 }