private void loginButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (usernameTextBox.Text == "")
                {
                    errorLabel.Content = "Please enter your Librarian username.";
                }
                else if (passwordTextBox.Password == "")
                {
                    errorLabel.Content = "Please enter your password.";
                }
                else
                {
                    LibrarianBLL user = null;

                    foreach (PersonBLL p in people)
                    {
                        if (p is LibrarianBLL l)
                        {
                            if (usernameTextBox.Text == l.UserID)
                            {
                                if (passwordTextBox.Password == l.Password)
                                {
                                    User         = l;
                                    DialogResult = true;
                                }
                            }
                        }

                        if (user == null)
                        {
                            errorLabel.Content = "Invalid username and password.";
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                errorLabel.Content = ErrorHandler.InnermostExceptionMessage(ex);
            }
        }
 public CheckInAndOutMenu(LibrarianBLL User, CardholderBLL Patron)
 {
     InitializeComponent();
     user   = User;
     patron = Patron;
 }
 //This constructor is used to display the user (librarian) data of the logged in librarian.
 public SearchResultsPage(BookSearch SearchResults, LibrarianBLL User)
     : this(SearchResults)
 {
     user = User;
     modeLabel.Content = user.LoginMessage();
 }
 public LibrarianMenu(LibrarianBLL librarian)
 {
     InitializeComponent();
     User = librarian;
 }