private async void loginButton_ClickAsync(object sender, EventArgs e) { string search = this.userNameInput.Text.ToString(); FirebaseResponse response = await client.GetTaskAsync(search); object x = response.GetType(); if (response.GetType() is ApplicationEngine.UserTypes.Librarian) { MessageBox.Show("woot"); } ApplicationEngine.UserTypes.Librarian lib = response.ResultAs <ApplicationEngine.UserTypes.Librarian>(); if (((ApplicationEngine.UserTypes.User)lib).Password != this.passwordInput.Text.ToString()) { MessageBox.Show("incorrect password"); } else { //if admin if (lib.Level > 0) { Admin.AdminUI.AdminMainScreenUI admin = new Admin.AdminUI.AdminMainScreenUI(); admin.ShowDialog(); MessageBox.Show("Admin"); } else if (lib.Level == 0) { Librarian.LibrarianMain library = new Librarian.LibrarianMain(); library.ShowDialog(); } else { MessageBox.Show("else"); } } if (shouldMoveOnPass && shouldMoveOnUser) { // We need to check database then the boolean shouldMoveOnUser should be switched to true if the credentials are found in db. // If db fails then we need to allow the user to reenter the information. } // Check that the network id box contains a vlaue // Password textbox is contains value // Query the database to see if the id exits, // If it does exist, check the corresponding password in the database is correct. // If true, proceed to the next screen // else, display appropriate message in teh response box. }