private void SaveExecute(object obj) { try { if (!JMBGValidation.IsValid(Manager.JMBG)) { MessageBox.Show("JMBG is not valid"); return; } else if (!hintPasswordValidation.PasswordOk(Manager.ReservedPassword)) { MessageBox.Show("Password Hint must contain at least 5 caracters!"); return; } string password = (obj as PasswordBox).Password; Manager.UserPassword = password; LoginScreen login = new LoginScreen(); serviceManager.AddManager(Manager); addManager.Close(); MessageBox.Show("Account created!"); login.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void Change_User(object sender, RoutedEventArgs e) { LoginScreen window = new LoginScreen(); window.ShowDialog(); this.Close(); }
protected override void OnStartup(StartupEventArgs e) { SystemPrincipal customPrincipal = new SystemPrincipal(); AppDomain.CurrentDomain.SetThreadPrincipal(customPrincipal); base.OnStartup(e); Smart365OperationsBootstrapper bootStrapper = new Smart365OperationsBootstrapper(); bootStrapper.Run(); ShutdownMode = ShutdownMode.OnExplicitShutdown; LoginScreen loginWindow = bootStrapper.Container.Resolve <LoginScreen>(); //AuthenticationViewModel viewModel = // new AuthenticationViewModel(bootStrapper.Container.Resolve<IAuthenticationService>()); //loginWindow.DataContext = viewModel; bool?logonResult = loginWindow.ShowDialog(); var viewModel = loginWindow.ViewModel as AuthenticationViewModel; if (logonResult.HasValue && viewModel != null && viewModel.IsAuthenticated) { bootStrapper.Show(); Current.ShutdownMode = ShutdownMode.OnMainWindowClose; } else { Application.Current.Shutdown(1); } }
private void SaveExecute(object obj) { try { bool existsFloor = false; string password = (obj as PasswordBox).Password; Employee.Password = password; for (int i = 0; i < floorManager.Count; i++) { if (Employee.Floor == floorManager[i]) { existsFloor = true; } } if (existsFloor) { LoginScreen login = new LoginScreen(); serviceEmployee.AddEmployee(Employee); addEmployee.Close(); MessageBox.Show("Account created!"); login.ShowDialog(); } else { MessageBox.Show("There is no Manager for that floor. Can not hire an employee!"); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void loginToolStripMenuItem1_Click(object sender, EventArgs e) { LoginScreen tela = new LoginScreen(); this.Hide(); tela.ShowDialog(); }
private void SaveExecute() { LoginScreen login = new LoginScreen(); service.AddOrder(Order); main.Close(); login.ShowDialog(); }
void SetLoginScreen() { this.Visibility = Visibility.Hidden; LoginScreen tmp = new LoginScreen(); tmp.OnWindowClosed += Tmp_OnWindowClosed; tmp.ShowDialog(); }
private void CloseExecute() { try { LoginScreen login = new LoginScreen(); managerWindow.Close(); login.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void SaveExecute() { try { LoginScreen login = new LoginScreen(); service.AddManager(Manager); addManager.Close(); login.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
public async Task <bool?> LogIn() { var appKey = Settings.GetProtected(Settings.AppKeyKey); var token = Settings.GetProtected(Settings.RefreshTokenKey); if (!string.IsNullOrWhiteSpace(appKey) && !string.IsNullOrWhiteSpace(token)) { return(await LogIn(appKey, token)); } else { var login = new LoginScreen(this); return(login.ShowDialog()); } }
private bool?RunLogin(LoginScreen log) { log = new LoginScreen() { Title = "Login to University Logbook" }; var _dialogres = log.ShowDialog(); if (_dialogres == true) { isAdmin = log.IsAdmin; TeachID = log.Teacher; return(true); } return(false); }
private String ShowLoginDialog() { LoginScreen ls = new LoginScreen(); ls.ShowDialog(); if (ls.DialogResult.HasValue && ls.DialogResult.Value) { loggedIn = true; return(ls.GetPassword()); } else { loggedIn = false; Application.Current.Shutdown(); } return(null); }
private void SaveExecute(object obj) { try { string password = (obj as PasswordBox).Password; Manager.Password = password; LoginScreen login = new LoginScreen(); serviceManager.AddManager(Manager); addManager.Close(); MessageBox.Show("Account created!"); login.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void mostrar_InicioDeSesion() { LoginScreen login_scr = new LoginScreen(); login_scr.ShowDialog(); if (Sesion.iniciada) { ActualizarStatusStrip(); habilitar_segun_rol(); linkLabelCerrar.Visible = true; linkLabel_Login.Visible = false; if (Sesion.user_id != "Guest") { linkLabel_pass.Visible = true; } } }
protected override void OnStartup(StartupEventArgs e) { bool can_execute = true; try { mutex = new System.Threading.Mutex(false, "SMART365CLIENT", out can_execute); } catch (Exception ex) { } if (can_execute) { SystemPrincipal customPrincipal = new SystemPrincipal(); AppDomain.CurrentDomain.SetThreadPrincipal(customPrincipal); base.OnStartup(e); Smart365OperationsBootstrapper bootStrapper = new Smart365OperationsBootstrapper(); bootStrapper.Run(); ShutdownMode = ShutdownMode.OnExplicitShutdown; LoginScreen loginWindow = bootStrapper.Container.Resolve <LoginScreen>(); //AuthenticationViewModel viewModel = // new AuthenticationViewModel(bootStrapper.Container.Resolve<IAuthenticationService>()); //loginWindow.DataContext = viewModel; bool?logonResult = loginWindow.ShowDialog(); var viewModel = loginWindow.ViewModel as AuthenticationViewModel; if (logonResult.HasValue && viewModel != null && viewModel.IsAuthenticated) { bootStrapper.Show(viewModel.DisplayName); Current.ShutdownMode = ShutdownMode.OnMainWindowClose; } else { Application.Current.Shutdown(1); } } else { System.Diagnostics.Debug.WriteLine("SMART365CLIENT already running!"); Application.Current.Shutdown(1); } }
private void SaveExecute(object obj) { try { if (!JMBGValidation.IsValid(Admin.JMBG)) { MessageBox.Show("JMBG is not valid"); return; } string password = (obj as PasswordBox).Password; Admin.UserPassword = password; LoginScreen login = new LoginScreen(); seerviceAdmin.AddAdmin(Admin); addAdmin.Close(); MessageBox.Show("Account created!"); login.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
public bool LogIn() { var login = new LoginScreen(this); return(login.ShowDialog().Value); }
private void BtnLogin_Click(object sender, RoutedEventArgs e) { LoginScreen login = new LoginScreen(this); login.ShowDialog(); }