コード例 #1
0
        private void btnLogIn_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var loginValidationService = new LoginValidation();

                var isValid = loginValidationService.UsernamePasswordValidation(tbUserName.Text.ToString(), tbxPassword.Password.ToString());

                if (isValid)
                {
                    AdminHome adminHome = new AdminHome();
                    adminHome.Show();
                    this.Close();
                }
                else
                {
                    //Things which happen before the timer starts
                    lableWrongPassword.Visibility = Visibility.Visible;
                    //Start the timer
                    dispatcherTimer.Start();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString(), "Error");
            }
        }