private void add_lec1_button_Click(object sender, EventArgs e) { tempCon[4] = selectedcourse.getID().ToString(); tempCon[5] = "0"; tempCon[6] = "Lecture"; tempCon[7] = Class_lec1_comboBox.SelectedItem.ToString(); tempCon[8] = selectedcourse.getName(); tempCon[9] = "None"; tempCon[10] = selectedcourse.getYear().ToString(); tempCon[11] = selectedcourse.getSemester().ToString(); constraints toinit = new constraints(tempCon); allconstraintsobjects.Add(toinit); (this.Owner as Schedule_Board).initialise_new_event(toinit); toinit.addthistodb(); MessageBox.Show("meaniyen"); if (this.selectedcourse.get_amount_of_lecture_sessions() == 2) { Lec2Panel.Show(); Lec2Panel.Enabled = true; } else { prapanel.Enabled = true; } lec1panel.Enabled = false; }
/*ctors*/ public AddCourseToBoard(object selectedcourse)//ctor recives scheduleboard form { InitializeComponent(); allconstraintsobjects = constraints.getallconstraints(); for (int i = 0; i <= 12; i++) // initialise two lists for constraints details { this.tempConPra.Add(null); //practice const this.tempCon.Add(null); //lecture const this.tempcon2.Add(null); } this.selectedcourse = selectedcourse as Course; if (this.selectedcourse.get_amount_of_lecture_sessions() > 1) { Lec2Panel.Show(); } }