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(); } }
public LoginViewModel(LoginDialog dialog) { if (ViewModelHelper.IsInDesignModeStatic == false) { this.initializeAllCommands(); this.dialog = dialog; //+ This is only neccessary if you want to display the appropriate image while typing the user name. //+ If you want a higher security level you wouldn't do this here ! //! Remember : ONLY for demonstration purposes I have used a local Collection //this.getAllUser(); } }
private void btnLogin_Click(object sender, RoutedEventArgs e) { LoginDialog dlg = new LoginDialog(); dlg.ShowDialog(); }