Beispiel #1
0
 public AddSubjectForm(Controller.UserAccount ua)
 {
     InitializeComponent();
     subjectName = string.Empty;
     subject     = new Controller.Subject();
     userAccount = ua;
 }
        private void comboBoxSemester_SelectionChangeCommitted(object sender, EventArgs e)
        {
            //MessageBox.Show("SelectionChangeCommitted.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            comboBoxSection.DataSource = null;
            comboBoxSection.Items.Clear();
            comboBoxSubject.DataSource = null;
            comboBoxSubject.Items.Clear();

            //comboBoxSection.Items.Remove(1);
            //for (int i = 0; i < comboBoxSection.Items.Count; i++)
            //{
            //    comboBoxSection.Items.RemoveAt(i);
            //}
            //comboBoxSection.Items.Remove(comboBoxSection.SelectedItem);

            Controller.Section section = new Controller.Section();
            Controller.Subject subject = new Controller.Subject();
            section.LoadAllSection(1, Convert.ToInt32(comboBoxSemester.SelectedValue), comboBoxSection);
            subject.LoadAllSubject(1, Convert.ToInt32(comboBoxSemester.SelectedValue), comboBoxSubject);
        }