Beispiel #1
0
        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 buttonHQCheck_Click(object sender, EventArgs e)
        {
            String Error = null;

            if (FormMaintance.ConnectionCheck(this.textBoxHQDataSource.Text,
                                              this.textBoxHQDatabase.Text,
                                              this.textBoxHQUser.Text,
                                              this.textBoxHQPassword.Text, ref Error))
            {
                MessageBox.Show(this, "Connection Success", "Success", MessageBoxButtons.OK);
            }
            else
            {
                MessageBox.Show(this, "Connection Failed\n" + Error, "Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #3
0
 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();
     }
 }