public SelectionMenuStudent(Student stu) { InitializeComponent(); this.student = stu; topicGrid.IsReadOnly = true; membersgrid.IsReadOnly = true; topicGrid.ItemsSource = MenuStudentLogic.getSectionList(student.ID_Album); studentSemest = MenuStudentLogic.getStudentSemestr(student.ID_Album); }
private void OpenWindow(object sender, RoutedEventArgs e) { /*SelectionMenuAdmin objSMA = new SelectionMenuAdmin(); * this.Visibility = Visibility.Hidden; * objSMA.Show(); */ log_t = login_text.Text; if (login_text.Text == "" || password_text.Password == "") { MessageBox.Show("Uzupełnij pola login oraz hasło!", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } else { string role; int id; bool access = Login.login(login_text.Text, password_text.Password, out role, out id); role = role.Trim(' '); if (access) { if (role == "admin") { SelectionMenuAdmin admin_window = new SelectionMenuAdmin(); admin_window.Show(); } else if (role == "student") { Student stu = MenuStudentLogic.getStudentInfo(id); SelectionMenuStudent student_window = new SelectionMenuStudent(stu); student_window.Show(); } else if (role == "lecturer") { Lecturer lectu = MenuLecturerLogic.getLectuterData(id); // MessageBox.Show(lectu.Surname); SelectionMenuLecturer lecturer_window = new SelectionMenuLecturer(lectu); lecturer_window.Show(); } else { MessageBox.Show("Samfing is not yes!"); } } else { MessageBox.Show("Błędne dane logowania!"); } } }
private void Button_Click(object sender, RoutedEventArgs e) { topicGrid.ItemsSource = MenuStudentLogic.getSectionWithCondition(studentSemest, subject_name.Text); }