예제 #1
0
 /// <summary>
 /// Insert new subject via form FormEditSubject
 /// </summary>
 private void InsertSubject()
 {
     using (FormEditSubject formEditSubject = new FormEditSubject(connectionString))
     {
         formEditSubject.ShowDialog();
     }
 }
예제 #2
0
        /// <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();
            }
        }