private void CheckUser(object sender, RoutedEventArgs e) { mainDal check = new mainDal(); if (teacher.IsChecked.Equals(true)) { if (check.Login(this.username.Text, this.password.Password, "teacher")) { adminBoard a = new adminBoard(); name = this.username.Text; a.Name1 = name; a.Show(); } else { MessageBox.Show("Invalid Password"); } } else if (student.IsChecked.Equals(true)) { if (check.Login(this.username.Text, this.password.Password, "student")) { studentBoard s = new studentBoard(); s.Name1 = this.username.Text; s.Show(); } else { MessageBox.Show("Invalid Password"); } } }