Beispiel #1
0
        private void Button_Login_Click(object sender, RoutedEventArgs e)
        {
            User user          = new User();
            var  saver         = new Saver();
            var  Users_List_DB = saver.LOAD_USER();

            user = new User(Login: Text_button.Text, Password: Password_button.Password);
            if (Users_List_DB.CheckForCorrectUserAndPassword(user))
            {
                HasErrorLabel.Foreground = Brushes.Green;
                HasErrorLabel.Text       = "Success enter";
                User.currentUser         = Users_List_DB.GetCurrentUser(user);

                AppWidnow appWidnow = new AppWidnow();
                this.Hide();
                appWidnow.ShowDialog();
                this.Show();
            }
            else
            {
                HasErrorLabel.Foreground = Brushes.Red;
                HasErrorLabel.Text       = "This user dosen't exist";
            }
        }