private void addTeacherMenu_Click(object sender, EventArgs e)
        {
            Teacher    newTeacher = new Teacher(string.Empty, string.Empty, DateTime.Now);
            NewTeacher form       = new NewTeacher(newTeacher, newTeacher, true);

            form.Show();
        }
        private void btnAdd_Click(object sender, EventArgs e)
        {
            Teacher    newTeacher     = new Teacher(string.Empty, string.Empty, DateTime.Now);
            NewTeacher NewTeacherForm = new NewTeacher(newTeacher, newTeacher, true);

            NewTeacherForm.Show();
            NewTeacherForm.FormClosed += NewTeacherForm_FormClosed;
        }
 private void btnEdit_Click(object sender, EventArgs e)
 {
     if (dgvAllTeachers.SelectedRows.Count > 0)
     {
         //grab selected object
         Teacher currentTeacher = (Teacher)dgvAllTeachers.SelectedRows[0].DataBoundItem;
         //provided parameters will open an edit form for teacher
         //last parameter which is boolean is responsible for opening adding or editing form
         NewTeacher NewTeacherForm = new NewTeacher(currentTeacher, currentTeacher, false);
         NewTeacherForm.Show();
     }
 }