예제 #1
0
        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 !");
            }
        }
예제 #2
0
 public void CloseLoginWindow()
 {
     _loginWindow.Close();
 }