private void deleteStudentMenuItem_Click(object sender, EventArgs e) { int studentId = Program.SHOW_STUDENTS.GetCurrentStudentId(); Dictionary <String, String> student = sd.GetStudentDataById(studentId); EditStudent editStu = new EditStudent(student); editStu.ShowDialog(); }
private void editStudentMenuItem_Click(object sender, EventArgs e) { int studentId = Program.SHOW_STUDENTS.GetCurrentStudentId(); Dictionary <String, String> student = sd.GetStudentDataById(studentId); bool formOpen = false; for (int i = 0; i < Application.OpenForms.Count; i++) { Form current = Application.OpenForms[i]; if (current.Name == "EditStudent") { current.BringToFront(); formOpen = true; } } if (!formOpen) { EditStudent form = new EditStudent(student); form.Name = "EditStudent"; form.Show(); } }