Ejemplo n.º 1
0
        private void RegisterButton_Click(object sender, EventArgs e)
        {
            string first_name       = FirstNameTextBox.Text;
            string last_name        = LastNameTextBox.Text;
            string affilation       = AffilationTextBox.Text;
            string username         = UsernameTextbox.Text;
            string password         = PasswordTextbox.Text;
            string confirm_password = ConfirmPasswordTextBox.Text;
            string email            = EmailTextBox.Text;
            string role             = comboBoxRole.Text;


            try
            {
                //validari pe date
                ValidationData validation = new ValidationData();
                validation.validateEmail(email);
                validation.validatePassword(password, confirm_password);
                validation.validateExists(username, first_name, last_name, affilation, role);

                //trimitere la controller datele validate
                reg_controller.register(first_name, last_name, affilation, username, password, email, role);
                ValidationWindow validationWindow = new ValidationWindow(email, reg_controller);
                validationWindow.Show();
                this.Hide();
            }
            catch (DataException exp) {
                MessageBox.Show(exp.Message);
            }
        }