private void newLecturerToolStripMenuItem_Click(object sender, EventArgs e) { LecturerForm form = new LecturerForm(); form.SetLecturer(new Lecturer()); form.Show(this); form.FormClosed += LecturerForm_Closed; }
private void editLecturerToolStripMenuItem_Click(object sender, EventArgs e) { LecturerForm form = new LecturerForm(); int index = LecturersGridView.CurrentCell.RowIndex; form.SetLecturer(new Lecturer() { Id = (int)LecturersGridView["Id", index].Value, Name = LecturersGridView["Name", index].Value.ToString() }); form.Show(this); form.FormClosed += LecturerForm_Closed; }