Пример #1
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            RegistrationView rw = new RegistrationView();

            rw.Show();
            this.Close();
        }
 private void ConfirmCommandExecute(object obj)
 {
     try
     {
         string password     = (obj as PasswordBox).Password;
         string filePassword = RandomPasswordGenerator.ReadManagerPassword();
         if (password.Equals(filePassword))
         {
             AddManagerView managerView = new AddManagerView();
             managerPasswordEnterView.Close();
             registration.Close();
             managerView.Show();
             return;
         }
         else
         {
             if (retryCounter == 0)
             {
                 MessageBox.Show("You have exeeded maximum number of tries.\nReturning to registration screen.");
                 RegistrationView registrationView = new RegistrationView(retryCounter);
                 managerPasswordEnterView.Close();
                 registration.Close();
                 registrationView.Show();
             }
             else
             {
                 MessageBox.Show($"Wrong password. Remaining number of tries: {--retryCounter}");
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
Пример #3
0
        private void ExitExecute()
        {
            RegistrationView registrationWindow = new RegistrationView(true);

            confirmOperation.Close();
            registrationWindow.Show();
        }
Пример #4
0
 private void AddNewManagerExecute(object obj)
 {
     try
     {
         string password = (obj as PasswordBox).Password;
         if (managerCodes.Contains(password) && count < 3)
         {
             AddNewManagerView addNewManagerViewView = new AddNewManagerView();
             view.Close();
             addNewManagerViewView.ShowDialog();
             return;
         }
         else if (count < 2)
         {
             count++;
             int attempts = GetLeftAttempts();
             MessageBox.Show($"Code is wrong. You have {attempts} more attempts.");
             return;
         }
         else
         {
             MessageBox.Show("You can not create mannager type of account, continue with creating the employee account.");
             RegistrationView registrationWindow = new RegistrationView(false);
             registrationWindow.Show();
             view.Close();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
Пример #5
0
        private void RegistrationButton(Window obj)
        {
            var register = new RegistrationView();

            register.Show();
            obj.Close();
        }
Пример #6
0
        private void Register(object obj)
        {
            RegistrationView registrateView = new RegistrationView();

            loginView.Close();
            registrateView.Show();
            return;
        }