private void newBtn_Click(object sender, EventArgs e) { bool edit = false; CreateLesson createLesson = new CreateLesson(lessons, edit); createLesson.ShowDialog(); Global.changes = true; RefreshList(); }
private void editBtn_Click(object sender, EventArgs e) { bool edit = true; int curIndex = -1; if (lessonBox.SelectedIndex != -1) { curIndex = lessonBox.SelectedIndex; } if (lessonBox.SelectedIndex == -1) { MessageBox.Show("Please Select Lesson"); return; } selected = lessons[curIndex]; CreateLesson createLesson = new CreateLesson(lessons, edit, selected); createLesson.ShowDialog(); Global.changes = true; RefreshList(); lessonBox.SelectedIndex = curIndex; }