Exemple #1
0
        private void LoadAsstList()
        {
            ListCourse course = (ListCourse)lstCourses.SelectedItem;

            Assignment[] assts;
            try {
                assts = m_cds.GetAssignments(course.Course.ID);
            } catch (Exception er) {
                MessageBox.Show("Error: " + er.Message, "Error connecting to FrontDesk",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            lstAssts.BeginUpdate();
            lstAssts.Items.Clear();
            foreach (Assignment asst in assts)
            {
                lstAssts.Items.Add(new ListAsst(asst));
            }
            lstAssts.EndUpdate();

            if (lstAssts.Items.Count == 0)
            {
                Wizard.SetWizardButtons(WizardButton.Back);
            }
            else
            {
                Wizard.SetWizardButtons(WizardButton.Back | WizardButton.Next);
                lstAssts.SelectedIndex = 0;
            }
        }