private void txt_LoginName_LostFocus(object sender, RoutedEventArgs e)
 {
     if (!RegExpressions.RegexValidateEventName(txt_LoginName.Text))
     {
         WPFMessageBox.Show("Administrator names may only include numbers and letters.");
         btn_Save.IsEnabled = false;
     }
     else if ((lst_AdminList.Items.Contains(txt_LoginName.Text) && !(lst_AdminList.SelectedItem.ToString().Equals(txt_LoginName.Text))) || txt_LoginName.Text.Equals("superuser"))
     {
         WPFMessageBox.Show("An administrator with that name already exists. Please change the login name to be unique before continuing");
         btn_Save.IsEnabled = false;
     }
 }
        private void btn_Save_Click(object sender, RoutedEventArgs e)
        {
            if (!RegExpressions.RegexValidateEventName(txt_LoginName.Text))
            {
                WPFMessageBox.Show("Administrator names may only include numbers and letters.");
                btn_Save.IsEnabled = false;
            }
            else
            {
                //this check will ensure that if the user is logged in as the currently selected administrator and changes their name it won't break functionality
                if (lst_AdminList.SelectedItem.ToString().Equals(loggedInAs))
                {
                    loggedInAs = txt_LoginName.Text;
                }

                if (pwChanged)
                {
                    if (rdb_Full.IsChecked == true)
                    {
                        db.UpdateAdmin(lst_AdminList.SelectedItem.ToString(), txt_LoginName.Text, txt_Password.Password, txt_Email.Text, "1");
                    }
                    else if (rdb_Limited.IsChecked == true)
                    {
                        db.UpdateAdmin(lst_AdminList.SelectedItem.ToString(), txt_LoginName.Text, txt_Password.Password, txt_Email.Text, "2");
                    }
                }
                else
                {
                    if (rdb_Full.IsChecked == true)
                    {
                        db.UpdateAdmin(lst_AdminList.SelectedItem.ToString(), txt_LoginName.Text, txt_Email.Text, "1");
                    }
                    else if (rdb_Limited.IsChecked == true)
                    {
                        db.UpdateAdmin(lst_AdminList.SelectedItem.ToString(), txt_LoginName.Text, txt_Email.Text, "2");
                    }
                }

                lst_AdminList.ItemsSource = db.FindAdmins();
                clearForm();
            }
        }