Beispiel #1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            try
            {
                MainWindow main = null;
                if (string.IsNullOrEmpty(GlassProductManager.Properties.Settings.Default.ConnectionString) == false)
                {
                    SQLHelper.ConnectionString = GlassProductManager.Properties.Settings.Default.ConnectionString;
                }

                if (string.IsNullOrEmpty(SQLHelper.ConnectionString) == false)
                {
                    //main = new MainWindow();
                    //main.ShowDialog();
                    //main.Close();
                }
                else
                {
                    ConfigureDatabase configureDB = new ConfigureDatabase();
                    configureDB.ShowDialog();
                    if (configureDB.IsDatabaseReady)
                    {
                        //main = new MainWindow();
                        //main.ShowDialog();
                        //main.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
        }
Beispiel #2
0
 private void btnConfigureDatabase_Click(object sender, RoutedEventArgs e)
 {
     ConfigureDatabase configure = new ConfigureDatabase();
     configure.ShowDialog();
 }
 private void btnConfigureDatabase_Checked(object sender, RoutedEventArgs e)
 {
     try
     {
         ConfigureDatabase configureDB = new ConfigureDatabase();
         configureDB.ShowDialog();
         btnConfigureDatabase.IsChecked = false;
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
     }
 }