Beispiel #1
0
        //--- display choosen course information
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                Instructors.Items.Clear();
                int          crsId = (int)comboBox1.SelectedItem;
                Online_Exame ent   = new Online_Exame();
                var          item  = (from d in ent.courses
                                      where d.C_id == crsId
                                      select d).First();
                textBox1.Text = item.C_name;

                //get instructors of the course
                var items = ent.get_course_instructors(crsId);
                foreach (var i in items)
                {
                    Instructors.Items.Add(i);
                }
            }
            catch (InvalidOperationException)
            {
                Instructors.Items.Add("No instructor");
            }
        }