private void LanguageForm_FormClosing(object sender, FormClosingEventArgs e) { if (IsModified(_selectedRecord)) { DialogResult select = DisplayHelper.QuestionYesNo(this, "There are unsaved changes. Are you sure want to exit?"); if (select == DialogResult.Yes) { e.Cancel = false; _context.Dispose(); Dispose(); } else e.Cancel = true; } else { e.Cancel = false; _context.Dispose(); Dispose(); } }
private void InvMaint_FormClosing(object sender, FormClosingEventArgs e) { if (!BarToggleSwitchItemBuild.Checked && IsModified(_selectedRecord)) { DialogResult select = DisplayHelper.QuestionYesNo(this, "There are unsaved changes. Are you sure want to exit?"); if (select == DialogResult.Yes) { e.Cancel = false; _context.Dispose(); Dispose(); } else { e.Cancel = true; } } else { e.Cancel = false; _context.Dispose(); Dispose(); } }
private void MGMRatesImportForm_FormClosed(object sender, FormClosedEventArgs e) { _sys.Dispose(); _context.Dispose(); }