/// <summary> /// Create lesson button (eventhandler click) /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_create_lesson_Click(object sender, EventArgs e) { //Hide this form this.Hide(); //Create new instance of form var Create_Lesson = new Teacher_Make_New_Sets(Logged_In_User); Create_Lesson.Closed += (s, args) => this.Close(); //Open new form Create_Lesson.Show(); }
/// <summary> /// Edit a lesson /// </summary> private void EditLesson() { //If a lesson has been selected if (CB_Lessons.SelectedIndex > -1) { //Open new instance of DB class DBRepository DB = DBRepository.GetInstance(); //Get Lesson ID by Lesson Name int lesson_id = DB.FindLessonIDByName(CB_Lessons.SelectedItem.ToString()); bool editchar = true; //Hide this form and open the "Make a new lesson" Form this.Hide(); var make_new_lesson = new Teacher_Make_New_Sets(lesson_id, editchar, Logged_In_User); make_new_lesson.Closed += (s, args) => this.Close(); make_new_lesson.Show(); } else { } }