Ejemplo n.º 1
0
        private void buttonAddSt_Click(object sender, EventArgs e)
        {
            var wnd = new DialogAdd();

            wnd.Lecturers = this.Lecturers;
            if (wnd.ShowDialog() == DialogResult.OK)
            {
                bs.ResetBindings(false);
                listBoxStudents.DataSource    = null;
                listBoxStudents.DataSource    = (comboBoxLecturer.SelectedItem as Lecturer).Students;
                listBoxStudents.DisplayMember = "FIO";
            }
        }
Ejemplo n.º 2
0
        private void ButtonChange_Click(object sender, EventArgs e)
        {
            if (listBoxStudents.SelectedItem == null)
            {
                return;
            }

            var wnd = new DialogAdd();

            wnd.Lecturers = this.Lecturers;
            var st = listBoxStudents.SelectedItem as Student;

            wnd.Student = st;

            wnd.ShowDialog();

            listBoxStudents.DataSource = null;

            listBoxStudents.DataSource    = (comboBoxLecturer.SelectedItem as Lecturer).Students;//
            listBoxStudents.DisplayMember = "FIO";
        }