示例#1
0
 public MembershipUser UserEntityToMemberShipUser(User u)
 {
     MembershipUser user = new MembershipUser(u.UserName, u.UserName, u.UserId, u.UserName,
         u.MemberShip.PasswordQuestion, "", true, u.MemberShip.IsLockOut, u.MemberShip.CreateDate,
         u.MemberShip.LastLoginDate, u.MemberShip.LastActivityDate, u.MemberShip.PasswordChangedDate,
         u.MemberShip.LastActivityDate);
     return user;
 }
示例#2
0
        public User MemberShipUserToUserEntity(MembershipUser mu)
        {
            User u = new User();
            u.UserName = mu.UserName;
            u.UserId = (int)mu.ProviderUserKey;
            u.MemberShip.PasswordQuestion = mu.PasswordQuestion;
            u.MemberShip.CreateDate = mu.CreationDate;
            u.MemberShip.PasswordChangedDate = mu.LastPasswordChangedDate;
            u.MemberShip.LastActivityDate = mu.LastActivityDate;
            u.MemberShip.LastLoginDate = mu.LastLoginDate;
            u.MemberShip.IsLockOut = mu.IsLockedOut;

            return u;
        }
示例#3
0
 public override string CreateUserAndAccount(string userName, string password, bool requireConfirmation, IDictionary<string, object> values)
 {
     var user = new User();
     user.UserName = userName;
     foreach (var value in values)
     {
         user.Profiles.Add(new UserProfile
         {
             ProfileKey = value.Key,
             ProfileValue = value.Value.ToString()
         });
     }
     new UserService().CreateUser(user);
     return this.CreateAccount(userName, password);
 }
示例#4
0
 public void UpdateUser(User user)
 {
     repository.Update<User>(user);
 }
示例#5
0
 public void DeleteUser(User user)
 {
     repository.Delete<User>(user);
 }
示例#6
0
 public void CreateUser(User user)
 {
     repository.Save<User>(user);
 }