Пример #1
0
        void SetFunctionalDatabase()
        {
            DatabaseConfiguration dbconf    = new DatabaseConfiguration();
            List <Database>       databases = dbconf.GetFunctionalDatabases();

            if (databases.Count == 0)
            {
                DialogResult result = MessageBox.Show("Det ser ikke ut at du har lagt til en funksjonell database enda, vil du gjøre det nå?", "Konfigurere database?", MessageBoxButtons.YesNo);
                if (result == DialogResult.Yes)
                {
                    AddDatabase databaseConfiguration = new AddDatabase();
                    databaseConfiguration.ShowDialog();
                    SetFunctionalDatabase();
                }
                else if (result == DialogResult.No)
                {
                    lbl_CurrentDatabase.Text = "Current database: No functional database found";
                }
            }
            else if (databases.Count >= 1)
            {
                StaticInfo.CurrentDatabase = databases[0];
                lbl_CurrentDatabase.Text   = "Current database: " + StaticInfo.CurrentDatabase.DatabaseName;
            }
        }
Пример #2
0
        private void MnStrp_ConfigureDB(object sender, EventArgs e)
        {
            AddDatabase databaseConfiguration = new AddDatabase();

            databaseConfiguration.ShowDialog();
            UpdateDBLabel();
        }