private void btnRegister_Click(object sender, EventArgs e) { List<string> registrationMessages = RegistrationValidation.validateRegistration(txtBoxFirstName.Text, txtBoxLastName.Text, txtBoxUsername.Text, txtBoxPassword.Text, txtBoxRepeatPassword.Text, txtBoxEmail.Text); if (registrationMessages.Count == 0) { MessageBox.Show("Регистрирахте се успешно!"); this.Close(); } else { ErrorListView errors = new ErrorListView(registrationMessages); errors.ShowDialog(); } }
private void btnLogin_Click(object sender, EventArgs e) { LoginValidation login = new LoginValidation(txtBoxUsername.Text, txtBoxPassword.Text); User user; List<string> loginMessages = login.ValidateUserInput(out user); if (loginMessages.Count == 0) { this.user = user; this.DialogResult = DialogResult.OK; this.Hide(); HomeView homeView = new HomeView(user); } else { ErrorListView errors = new ErrorListView(loginMessages); errors.ShowDialog(); } }