Exemple #1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            string Name_con    = Name_condition.Text;
            string Surname_con = SurName_condition.Text;

            if (Name_con.Length == 0 && Surname_con.Length == 0)
            {
                MessageBox.Show("Wyplenij przynajmniej jedno z pol");
            }
            else if (Name_con.Length != 0 && Surname_con.Length == 0)
            {
                StudentGrid.ItemsSource = MenuLecturerLogic.getFreeStudentInSem(semester, selected_sec.ID_sekcji).Where(x => x.Name.Trim() == Name_con.Trim());
            }
            else if (Surname_con.Length != 0 && Name_con.Length == 0)
            {
                StudentGrid.ItemsSource = MenuLecturerLogic.getFreeStudentInSem(semester, selected_sec.ID_sekcji).Where(x => x.Surname.Trim() == Surname_con.Trim());
            }
            else if (Surname_con.Length != 0 && Name_con.Length != 0)
            {
                StudentGrid.ItemsSource = MenuLecturerLogic.getFreeStudentInSem(semester, selected_sec.ID_sekcji).Where(x => x.Surname.Trim() == Surname_con.Trim() && x.Name.Trim() == Name_con.Trim());
            }
            else
            {
                MessageBox.Show("Samfing is not yes :(");
            }
        }
Exemple #2
0
 public SML_Stu_Add(Semester sems, MenuLecturerLogic.SectionDisplay selected_sec, int studentinsecnumber)
 {
     InitializeComponent();
     this.semester           = sems;
     this.selected_sec       = selected_sec;
     free_space              = selected_sec.Max_User - studentinsecnumber;
     StudentGrid.ItemsSource = MenuLecturerLogic.getFreeStudentInSem(semester, selected_sec.ID_sekcji);
 }