Ejemplo n.º 1
0
        private void btnback_Click(object sender, RoutedEventArgs e)
        {
            MainOperator main = new MainOperator();

            main.Show();
            this.Close();
        }
Ejemplo n.º 2
0
        private void btnLogin_Click(object sender, RoutedEventArgs e)
        {
            String userName = txtBxuserName.Text.ToLower();
            string pass     = passBxPassword.Password;

            lblfrgtPass.Visibility   = Visibility.Hidden;
            lblLoading.Visibility    = Visibility.Visible;
            Mouse.OverrideCursor     = Cursors.Wait;
            txtBxuserName.IsEnabled  = false;
            passBxPassword.IsEnabled = false;
            btnLogin.IsEnabled       = false;
            if (account.Username == txtBxuserName.Text && account.Password == passBxPassword.Password)
            {
                if (bw.IsBusy == false)
                {
                    bw.RunWorkerAsync();
                }

                MainOperator main = new MainOperator();
                main.Show();
                this.Close();
            }
            else
            {
                lblLoading.Visibility      = Visibility.Hidden;
                lblfrgtPass.Visibility     = Visibility.Visible;
                lblfrgtPass.Content        = "Hibás kód!";
                txtBxuserName.IsEnabled    = true;
                txtBxuserName.BorderBrush  = Brushes.Red;
                passBxPassword.IsEnabled   = true;
                passBxPassword.BorderBrush = Brushes.Red;
                btnLogin.IsEnabled         = true;
                Mouse.OverrideCursor       = null;
            }
        }