Exemple #1
0
        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();
            }
        }
Exemple #2
0
        private void LoadData() // Load All Data For LoginPage
        {
            txt_UserName.Text = Registery.LoadDataOnRegistry();
            string getConnectionString = "";

            if (Registery.LoadConnectionString(getConnectionString))
            {
                Btn_Login.IsEnabled = true;
            }
            else
            {
                Btn_Login.IsEnabled = false;
                if (MessageBox.Show("Connection Error ,are you repair connection string? ",
                                    "Error",
                                    MessageBoxButton.YesNo,
                                    MessageBoxImage.Error) ==
                    MessageBoxResult.Yes)
                {
                    SettingsDB SettingWindow = new SettingsDB {
                    };
                    SettingWindow.ShowDialog();
                    Btn_Login.IsEnabled = true;
                }
            }
        }
Exemple #3
0
        private void Btn_Setting_LoginPage_Click(object sender, RoutedEventArgs e)
        {
            SettingsDB ShowSettingsDBWinddow = new SettingsDB
            {
            };

            ShowSettingsDBWinddow.ShowDialog();
        }
Exemple #4
0
        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();
            }
        }
Exemple #5
0
        private void DBSettings_Click(object sender, RoutedEventArgs e)
        {
            SettingsDB f = new SettingsDB();

            f.ShowDialog();
        }