private void settingsToolStripMenuItem_Click(object sender, EventArgs e) { var window = new FormMaintance(); if (window.Authorize()) { window.ShowDialog(this); } this.toolStripStatusLabelLocation.Text = "Location: " + SettingsProvider.GetDatabase().Replace("GS", ""); }
private void FormExtendedWarrenty_Load(object sender, EventArgs e) { if (SettingsProvider.GetDataSource().Length == 0) { var window = new FormMaintance(); window.ShowDialog(this); } try { List <String> Countries = AppBase.DataHelper.DataProvider.GetCountries(); this.comboBoxCountry.DataSource = Countries; this.comboBoxCountry.SelectedIndex = -1; } catch (System.Data.SqlClient.SqlException ex) { DialogResult result = MessageBox.Show(this, ex.Message + Environment.NewLine + "Do you want to change the Settings?" , "Error Occurred Exiting.", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); if (result == System.Windows.Forms.DialogResult.Yes) { var window = new FormMaintance(); if (window.Authorize()) { window.ShowDialog(this); } } } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error Occurred Exiting."); this.Close(); } }