private void viewUsers_Click(object sender, RoutedEventArgs e) { //false means it isn't a search click and null means no text was entered ViewUsers allUsers = new ViewUsers(false, null); frameMain.Navigate(allUsers); }
//this is used to determine if the search if from a teacher or headmaster private void Search_Click(object sender, RoutedEventArgs e) { //this checks to see who is the user so it will go to the right frame //true is passed to let frame know this is a search click and the search term is passed as well if (txtBoxSearch.Text == "") { txtBoxSearch.Text = "Field was left empty!"; } else { if (curUser.user_role == "headmaster") { ViewUsers userSearch = new ViewUsers(true, txtBoxSearch.Text); frameMain.Navigate(userSearch); } else if (curUser.user_role == "teacher") { viewStudents studentSearch = new viewStudents(curUser.user_id, true, txtBoxSearch.Text); frameMain.Navigate(studentSearch); } } }