private void AddRowAdressButton_Click(object sender, EventArgs e) { _crudStudent = new CRUDStudent(student); using (var newAdressForm = new AdressForm(adressDataTable, _crudStudent, currentRowIndex, FlagAddOrUpdate.Addition)) { newAdressForm.ShowDialog(); } SetButtonsAdressEnabledOrDisabled(); }
private void UpdateRowAdressButton_Click(object sender, EventArgs e) { currentRowIndex = GetCurrentRowIndexAdressDataGridView(); if (currentRowIndex == null) { return; } using (var newAdressForm = new AdressForm(adressDataTable, _crudStudent, currentRowIndex, FlagAddOrUpdate.Update)) { newAdressForm.ShowDialog(); } }