private void DiscipineListView_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { var discId = ((List<DisciplineView>)DiscipineListView.DataSource)[e.RowIndex].DisciplineId; var tefd = _repo.GetFirstFiltredTeacherForDiscipline(tfd => tfd.Discipline.DisciplineId == discId); if (tefd != null) { var addLessonForm = new AddLesson(_repo, tefd.TeacherForDisciplineId); addLessonForm.Show(); } else { var addLessonForm = new AddLesson(_repo); addLessonForm.Show(); } }
private void Button1Click(object sender, EventArgs e) { var addLessonForm = new AddLesson(_repo); addLessonForm.Show(); }