Example #1
0
 public AccountRegistration(Username username, Password password, FullName fullName, EmailAddress email)
 {
     Email = email;
     Username = username;
     Password = password;
     FullName = fullName;
 }
Example #2
0
 private bool Equals(FullName other)
 {
     return Equals(this.FamilyName, other.FamilyName) && Equals(this.GivenNames, other.GivenNames);
 }
Example #3
0
 public User(UserId userId, FullName fullName)
 {
     Id = userId;
     FullName = fullName;
 }
Example #4
0
        public ActionResult SignUp(AccountRegistration information)
        {
            var username = new Username(information.Username);

            bool usernameIsAvailable = _accountRegistrationService.IsUsernameAvailable(username);
            if (!usernameIsAvailable) {
                TempData.RegistrationFailureReason.Store(RegistrationFailureReason.UsernameNotAvailable);
                TempData.AccountRegistrationInformation.Store(information);
                return RedirectToAction<AccountController>(c => c.SignUp());
            }

            var password = new Password(information.Password);
            var passwordConfirmation = new Password(information.PasswordConfirmation);
            if (!password.Equals(passwordConfirmation)) {
                TempData.RegistrationFailureReason.Store(RegistrationFailureReason.PasswordsDoNotMatch);
                return RedirectToAction<AccountController>(c => c.SignUp());
            }

            var emailAddress = new EmailAddress(information.Email);
            var emailAddressConfirmation = new EmailAddress(information.EmailConfirmation);
            if (!emailAddress.Equals(emailAddressConfirmation)) {
                TempData.RegistrationFailureReason.Store(RegistrationFailureReason.EmailsDoNotMatch);
                return RedirectToAction<AccountController>(c => c.SignUp());
            }

            var foo = new GivenNames();

            var fullName = new FullName(new Name(information.LastName), new GivenNames(information.FirstName));
            var accountRegistration = new AccountManagement.AccountRegistration(username, password, fullName, new EmailAddress(information.Email));
            _accountRegistrationService.CreateAccount(accountRegistration);

            TempData.NewAccountUsername.Store(accountRegistration.Username);
            return RedirectToAction<AccountController>(c => c.SignUpComplete());
        }
 public AuthenticatedLoginControlViewModel(FullName userFullName, RouteValueDictionary dashboardPage)
 {
     UserFullName = userFullName;
     DashboardPage = dashboardPage;
 }