void clickLogin(PasswordBox pbox) { if (Username == null || pbox.Password == null) { return; } var dbContext = DataAccess.EstateManagerContext.Current; try { var loggedUser = dbContext.Users.Where(t => t.Username == Username && t.Password == pbox.Password).First(); DataAccess.ConnectionContext.ConnectedUser = loggedUser; System.Windows.MessageBox.Show("Bonjour " + Username + " !"); new Views.MainWindow().Show(); LoginWindow.Close(); } catch (Exception) { System.Windows.MessageBox.Show("Mot de passe ou pseudo incorrect !"); } }
public void CloseLoginWindow() { _loginWindow.Close(); }