/// <summary> /// Insert new subject via form FormEditSubject /// </summary> private void InsertSubject() { using (FormEditSubject formEditSubject = new FormEditSubject(connectionString)) { formEditSubject.ShowDialog(); } }
/// <summary> /// Update first selected dataGridViewSubject row via form FormEditSubject /// if nothing selected, return /// </summary> private void EditSubject() { // get first selected item to update DataGridViewRow selectedRow = GetSelectedRows().FirstOrDefault(); // nothing selected, return if (selectedRow == null) { return; } using (FormEditSubject formEditSubject = new FormEditSubject(connectionString, selectedRow)) { formEditSubject.ShowDialog(); } }