private Form1() { InitializeComponent(); Section s1 = new Section(1, Day.Monday, Hour.h_8_30); Section s2 = new Section(2, Day.Monday, Hour.h_11_30); Section s3 = new Section(3, Day.Tuesday, Hour.h_12_30); Section s4 = new Section(4, Day.Wednesday, Hour.h_13_30); Section s5 = new Section(2, Day.Thursday, Hour.h_10_30); Section s6 = new Section(1, Day.Friday, Hour.h_14_30); List <Section> sections1 = new List <Section>(); List <Section> sections2 = new List <Section>(); List <Section> sections3 = new List <Section>(); sections1.Add(s1); sections1.Add(s2); sections1.Add(s3); sections1.Add(s4); sections2.Add(s1); sections2.Add(s5); sections3.Add(s6); sections3.Add(s2); sections3.Add(s3); Course c1 = new Course("Fizik", 4, sections1); Course c2 = new Course("Kimya", 2, sections2); Course c3 = new Course("Matematik", 3, sections3); CourseManager.getInstance().addCourse(c1); CourseManager.getInstance().addCourse(c2); CourseManager.getInstance().addCourse(c3); }
private void btnAddCourse_Click(object sender, EventArgs e) { Course c = new Course(txtCourseName.Text, numOfSections, sections); CourseManager.getInstance().addCourse(c); this.Close(); Form1 form1 = Form1.getInstance(); form1.Form1_Load(sender, e); }
public void Form1_Load(object sender, EventArgs e) { cbxCourses.Items.Clear(); courses = CourseManager.getInstance().courseList; foreach (Course c in courses) { cbxCourses.Items.Add(c.name.ToString()); } dataGridView1.Rows.Clear(); insertRows(); }