private void RegistrerBrugerButton_Click(object sender, RoutedEventArgs e)
        {
            String firstname = textBoxFirstname.Text;
            String lastname = textBoxLastName.Text;
            String address = textBoxAddress.Text;
            long phonenumber = Convert.ToInt64(textBoxPhonenumber.Text);
            String username = textBoxUsername.Text;
            String password = textBoxPassword.Text;
            String passwordConfirm = textBoxPasswordConfirm.Text;
            if (password.Equals(passwordConfirm))
            {
                try
                {
                    User user = new User(firstname, lastname, address, phonenumber, username, password);
                    if (controller.createUser(user))
                    {
                        MessageBox.Show(AppResources.UserCreated);
                        NavigationService.Navigate(new Uri("/LoginLayout.xaml", UriKind.Relative));
                    }
                    else
                    {
                        MessageBox.Show(AppResources.UserNotCreated);
                    }

                }
                catch (Exception)
                {
                    MessageBox.Show(AppResources.UserRegitrationError);
                }
            }
            else
            {
                MessageBox.Show(AppResources.UserPasswordNotEquel);
            }
        }
Example #2
0
 public Boolean createUser(User user)
 {
     return dBFacade.createUser(user);
 }
Example #3
0
 public Boolean createUser(User user)
 {
     return dummyDB.createUser(user);
 }