예제 #1
0
        public MembershipCreateStatus CreateUser(string userName, string fullName, string password, string email, UserRole role)
        {
            ValidationUtil.ValidateRequiredStringValue(userName, "userName");
            ValidationUtil.ValidateRequiredStringValue(password, "password");
            ValidationUtil.ValidateRequiredStringValue(email, "email");

            var newUser = new User
                               {
                                   UserId = userName,
                                   FullName = fullName,
                                   Password = HashToBase64(password),
                                   PasswordIsHashed = true,
                                   Role = role,
                                   EmailAddress = email
                               };

            bool success = _userRepository.CreateOrUpdateUser(newUser);

            return success ? MembershipCreateStatus.Success : MembershipCreateStatus.UserRejected;
        }
예제 #2
0
 public void CreateUser(User user)
 {
     CreateUser(user.UserId, user.FullName, user.Password, user.EmailAddress, user.Role);
 }
예제 #3
0
        public bool CreateOrUpdateUser(User user)
        {
            CUDQuery query = session => session.SaveOrUpdate(user);

            return QueryExecutor.UpdateDelete(query);
        }