private void button3_Click(object sender, EventArgs e)
        {
            SchedulePreferencesSelection sps = new SchedulePreferencesSelection(selectedCourses, x, y, z);

            this.Hide();
            sps.ShowDialog();
            this.Close();
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            List <Course>             selectedCourses = new List <Course>();
            Dictionary <string, bool> taken           = new Dictionary <string, bool>();

            foreach (DataGridViewRow row in dataGridView2.Rows)
            {
                string CourseName = row.Cells[1].Value.ToString();
                if (Convert.ToBoolean(row.Cells[0].Value) == true)
                {
                    taken[CourseName] = true;
                }
                else
                {
                    taken[CourseName] = false;
                }
            }

            foreach (Course crs in courses)
            {
                if (!taken.ContainsKey(crs.CourseName))
                {
                    continue;
                }

                if (taken[crs.CourseName])
                {
                    selectedCourses.Add(crs);
                }
            }

            SchedulePreferencesSelection sps = new SchedulePreferencesSelection(selectedCourses, AvailableCourses, department, courses);

            //this.Hide();
            sps.ShowDialog();
            this.Close();
        }