public FormSecretary_AddOrRemoveLecture(int _id, string _password) { InitializeComponent(); string department; List <string> coursesProperties = new List <string>(); List <int> coursesID = new List <int>(); List <int> lecturesID = new List <int>(); id = _id; password = _password; department = SQLFunctions.getUsersDepartment(id); coursesProperties = SQLFunctions.findCoursePropertiesByDepartment(department); for (int i = 1; i < coursesProperties.Count; i += 9) { coursesID.Add(Convert.ToInt32(coursesProperties[i])); } for (int i = 0; i < coursesID.Count; i++) { lecturesID = SQLFunctions.findLecturesIDsForCourse(coursesID[i]); for (int j = 0; j < lecturesID.Count; j++) { lectureIDS.Add(lecturesID[j]); comboBox_Lectures.Items.Add(SQLFunctions.covertLectureIDtoLectureName(lecturesID[j]) + " " + lecturesID[j]); } } comboBox_Lectures.Items.Add("All"); this.AcceptButton = button_accept; textBox_StartTime.MaxLength = 2; textBox_EndTime.MaxLength = 2; textBox_day.MaxLength = 2; textBox_month.MaxLength = 2; textBox_year.MaxLength = 2; comboBox_AddRemove.DropDownStyle = ComboBoxStyle.DropDownList; comboBox_Lectures.DropDownStyle = ComboBoxStyle.DropDownList; }