Exemplo n.º 1
0
        private void LoginButtonClicked(object sender, EventArgs e)
        {
            Worker selectedEmployee = (Worker)workersDropdown.SelectedItem;
            string clearPassword    = passwordTextBox.Text.Trim() + AppConfig.GetPwdSuffix();

            errorLabel.Text = PasswordChecker.VerifyPassword(selectedEmployee.Name, clearPassword) == CheckerVerdict.OK? String.Empty: "Пароль неправильный.";
            if (String.IsNullOrEmpty(errorLabel.Text))
            {
                WorkerSheetForm workerSheet = new WorkerSheetForm(selectedEmployee.Name, clearPassword);
                this.Visible = false;
                workerSheet.ShowDialog();
                this.Close();
            }
            passwordTextBox.Text = String.Empty;
        }