コード例 #1
0
ファイル: Form1.cs プロジェクト: 7tepe/Course-Scheduler
        private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            buttonCancel.Visible = false;
            progressBar1.Visible = false;
            cur = dmp.ChooseCurriculum();
            for (int j = 1; j < 6; j++)
            {
                DataTable dt = new DataTable();
                dt.DefaultView.AllowDelete = false;
                dt.DefaultView.AllowEdit = false;
                dt.DefaultView.AllowNew = false;
                DataColumn sütun;
                DataRow satır;
                foreach (Classroom item in cur.ClassroomList)
                {
                    sütun = new DataColumn(item.Name);
                    dt.Columns.Add(sütun);

                }

                for (int i = 9; i < 17; i++)
                {
                    satır = dt.NewRow();
                    foreach (Classroom item in cur.ClassroomList)
                    {
                        foreach (Schedule item2 in item.scheduleList)
                        {
                            if (i >= item2.startHour && i < item2.endHour && item2.whichDay == j)
                            {
                                satır[item.Name] += " + " + item2.section.SectionCourse.Name + "-sec " + item2.section.Name;
                            }
                        }
                    }
                    dt.Rows.Add(satır);
                }
                switch (j)
                {
                    case 1:
                        dgw_mon_curri.DataSource = dt;
                        break;
                    case 2:
                        dgw_tues_curri.DataSource = dt;
                        break;
                    case 3:
                        dgw_wed_curri.DataSource = dt;
                        break;
                    case 4:
                        dgw_thur_curri.DataSource = dt;
                        break;
                    case 5:
                        dgw_fri_curri.DataSource = dt;
                        break;

                    default:
                        break;
                }
            }
            CB_prof_list.DataSource = cur.ProfessorList;
            progressBar1.Visible = false;
        }
コード例 #2
0
ファイル: Department.cs プロジェクト: 7tepe/Course-Scheduler
 public Department(int index, Faculty Connected_fac)
 {
     Curriculum curri = new Curriculum(this);
     ListCurriculum.Add(curri);
     this.departmen_name = Context.DEPARTMENTs.Where(p => p.DEPA_ID == index).Select(p => p.DEPA_NAME).ToString();
     this.faculty = Connected_fac;
 }
コード例 #3
0
ファイル: Semester.cs プロジェクト: 7tepe/Course-Scheduler
 public Semester(int id, string name, Curriculum curriculum )
 {
     this.ID = id;
     this.Name = name;
     this.curriculum = curriculum;
     courseList = new List<Course>();
 }
コード例 #4
0
ファイル: Curriculum.cs プロジェクト: 7tepe/Course-Scheduler
 public int CompareTo(Curriculum obj)
 {
     if (this.CalcFitness() > obj.CalcFitness())
     {
         return 1;
     }
     else { return -1; }
 }