private void registerButton_Click(object sender, RoutedEventArgs e) { UserRegister reg = new UserRegister(); if (reg.Register(this.nameTextBox.Text, this.passwordTextBox.Password, this.passwordVerifyTextBox.Password, this.fullNameTextBox.Text)) { this.registrationStatusLabel.Content = ""; this.DialogResult = true; } else { this.registrationStatusLabel.Content = reg.ErrorMessage; return; } }
public bool RegisterUser(string Name, string Email, string Password) { try { return(userRegister.Register(Name, Email, Password)); } catch (InvalidCastException e) { if (e.Source != null) { Console.WriteLine("IOException source: {0}", e.Source); } throw; } }