Beispiel #1
0
 private void AddDatabaseFileButton_Click(object sender, EventArgs e)
 {
     if (DatabaseFileDialog.ShowDialog() == DialogResult.OK)
     {
         string pathToDB = DatabaseFileDialog.FileName;
         OdbcConnectionStringBuilder connectionString = Database.ConnectionString(pathToDB);
         if (Database.Initialize(connectionString))
         {
             AddDatabaseFileButton.Enabled = false;
             SetDBFile(pathToDB);
             SessionStatusLabel.Text         = "Session Running";
             SessionStatusLabel.ForeColor    = Color.Green;
             OptionsButton.Visible           = true;
             AddHandRecordFileButton.Visible = true;
             HandsList handsList = new HandsList(connectionString);
             if (handsList.Count > 0)
             {
                 AddHandRecordFileButton.Enabled = false;
                 PathToHandRecordFileLabel.Text  = "Included in Scoring Database";
                 AnalysingLabel.Text             = "Analysing...";
                 AnalysingLabel.Visible          = true;
                 AnalysingProgressBar.Visible    = true;
                 AnalysisCalculationBackgroundWorker.RunWorkerAsync();
             }
         }
     }
 }
Beispiel #2
0
 private void AddDatabaseFileButton_Click(object sender, EventArgs e)
 {
     if (DatabaseFileDialog.ShowDialog() == DialogResult.OK)
     {
         pathToDB = DatabaseFileDialog.FileName;
         OdbcConnectionStringBuilder connectionString = Database.ConnectionString(pathToDB);
         if (Database.Initialize(connectionString))
         {
             AddDatabaseFileButton.Enabled = false;
             HandsList handsList = new HandsList(connectionString);
             if (handsList.Count == 0)
             {
                 PathToHandRecordFileLabel.Text  = "Please add a hand record (.pbn) file";
                 AddHandRecordFileButton.Visible = true;    // No hand records in database, so let user add them
             }
             else
             {
                 PathToHandRecordFileLabel.Text = "Included in Scoring Database";
                 StartSession();
             }
         }
     }
 }