Exemplo n.º 1
0
        private void InitView()
        {
            MY_COURSES_LISTVIEW.Items.Clear();
            AVAIL_COURSES_CB.Items.Clear();
            Student s = StudentTable.SelectOne(idStudent);
            Collection <ZapsanyKurz> signedCourses = ZapsanyKurzTable.SelectCoursesByIdStudent(idStudent);
            Collection <Kurz>        activeCourses = KurzTable.SelectByStudentAndOngoing(idStudent.ToString());

            foreach (var c in activeCourses)
            {
                AVAIL_COURSES_CB.Items.Add(c.Nazev);
            }

            if (signedCourses.Count > 0)
            {
                ZapsanyKurz firstCourse = signedCourses[0];

                foreach (var c in signedCourses)
                {
                    ListViewItem i = new ListViewItem(c.IdRegistrace.ToString());
                    i.SubItems.Add(c.Kurz.Nazev);
                    MY_COURSES_LISTVIEW.Items.Add(i);
                }
                InitCourse(firstCourse);
            }
        }