private void LoadSettings()
        {
            app = Application.Current as App;
            DB = DentalSmileDBFactory.GetInstance();

                //if (Smile.INSTALL)
            if(!DB.TestConnectionString())
            {
                SettingsDB dbForm = new SettingsDB();
                dbForm.ShowDialog();
                DB = DentalSmileDBFactory.GetInstance();
            }

            //detect if Admin  is NULL
            if (DB.selectDefaultAdmin() == null)
            {
                AdminPasswordDialog dlg = new AdminPasswordDialog();
                dlg.ShowDialog();
            }

            Smile.Phases = DB.SelectAllPhases();
            
            if (App.user == null)
            {
                //ChangePasswordDialog dlg = new ChangePasswordDialog();
                LoginDialog dlg = new LoginDialog();
                dlg.ShowDialog();
            }

        }
        private void LoadSettings()
        {
            //Smile.DbDatabase = Properties.Settings.Default.DbDatabase = "xx";
            //Smile.INSTALL = Properties.Settings.Default.InstallationMode = true;

            DentalSmileDB DB = DentalSmileDBFactory.GetInstance();
            ///TODO
            //test DB connection, if fail changes configuration
            //if (true)
            if (Smile.INSTALL)
            {
                SettingsDB dbForm = new SettingsDB();
                dbForm.ShowDialog();
                DB = DentalSmileDBFactory.GetInstance();
            }

            //detect if Admin  is NULL
            if (DB.selectDefaultAdmin() == null)
            {
                AdminPasswordDialog dlg = new AdminPasswordDialog();
                dlg.ShowDialog();
            }
        }
 private void DBSettings_Click(object sender, RoutedEventArgs e)
 {
     SettingsDB f = new SettingsDB();
     f.ShowDialog();
 }