Esempio n. 1
0
        public CreateCurri(List <Course> l_c)
        {
            InitializeComponent();

            String[] arr = new String[8];
            sm = new Curriculum [8];
            for (int i = 0; i < 8; i++)
            {
                sm[i]         = new Curriculum();
                sm[i].Courses = new List <Course>();
                string[] words = SqlWorker.GetCurriculumString(i + 1).Split(',');
                foreach (string word in words)
                {
                    if (word == "")
                    {
                        continue;
                    }
                    Course temp = l_c.Find(crs => crs.Name == word);
                    sm[i].Courses.Add(temp);
                }
            }
            foreach (Course cur in this.sm[0].Courses)
            {
                if (cur == null)
                {
                    continue;
                }
                this.semester_list_box.Items.Add(cur);
            }

            foreach (Course cur in l_c)
            {
                Boolean flag = true;
                for (int i = 0; i < 8; i++)
                {
                    if (sm[i].Courses != null)
                    {
                        foreach (Course c in sm[i].Courses)
                        {
                            if (cur.Name == c.Name)
                            {
                                flag = false;
                            }
                        }
                    }
                }
                if (flag)
                {
                    this.courses_list_box.Items.Add(cur);
                }
            }

            this.add_btn.Enabled   = false;
            this.rem_btn.Enabled   = false;
            this.rem_btn.BackColor = Color.Gray;
            this.add_btn.BackColor = Color.Gray;
        }
Esempio n. 2
0
 public Curriculum(int Semester)
 {
     this.Semester = Semester;
     Courses       = new List <Course>();
     Courses       = builder(SqlWorker.GetCurriculumString(this.Semester));
 }