private void buttonDeleteCurrentModel_Click(object sender, EventArgs e) { _databaseHelper.DeleteRegressionModelById(SelectedEquation.Id.Value); _regressionModels = _databaseHelper.GetAllRegressionModels(); _currentIndex = 0; ShowRegressionModel(); }
private void openRegressionModelsDatabaseToolStripMenuItem_Click(object sender, EventArgs e) { var allModels = _databaseHelper.GetAllRegressionModels(); var loginResult = new AuthorizationRegressionAnalysis().ShowDialog(); RegressionModelsDatabase databaseForm; switch (loginResult) { case DialogResult.Yes: databaseForm = new RegressionModelsDatabase(_databaseHelper, allModels, true); break; case DialogResult.No: databaseForm = new RegressionModelsDatabase(_databaseHelper, allModels, false); break; default: return; } var result = databaseForm.ShowDialog(); if (result == DialogResult.OK) { var selectedModel = databaseForm.SelectedEquation; if (selectedModel.IsLinearRegression) { _linearEquation = selectedModel; ShowLinearRegressionModel(); } else { _multipleRegressionEquation = selectedModel; ShowMultipleRegressionModel(); } } }