private void Add_Score_Load(object sender, EventArgs e) { //Find current teacher begin foreach (var teachers in db.Teachers) { if (teachers.Name == tName && teachers.Surname == tSurname) { ActiveTeacher = teachers; } } //Find current teacher end //Find Groups of teacher begin foreach (var courses in db.Teacher_Group_Subject) { if (courses.Teacher_ID == ActiveTeacher.id) { if (GroupList.Contains(courses.Group.Name)) { } else { GroupList.Add(courses.Group.Name); } } } //Find Groups of teacher end //Add combobox groups cmbGroup.Items.Clear(); foreach (var group in GroupList) { cmbGroup.Items.Add(group); } //Add combobox end }
public Teacher(Model.Teacher current) { InitializeComponent(); ActiveTeacher = current; }