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); } }
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); } }