Exemple #1
0
        public ExecuteResult RegisterBlogUser(AccountRegisterDTO dto)
        {
            ExecuteResult result = new ExecuteResult()
            {
                IsSuccess = true
            };

            if (this._userService.ExistUserName(dto.LoginName))
            {
                result.IsSuccess = false;
                result.Message   = "该用户名已经被注册";

                return(result);
            }

            var entity = Mapper.DynamicMap <UserInfoEntity>(dto);

            entity.PurviewID  = _userPurviewService.GetPurviewMap().Single(m => m.Value == "博客作者").Key;
            entity.LoginPWD   = EncryptHelper.Encrypt(dto.LoginPWD);
            entity.UserStatus = Enum.User.UserStatusEnum.Valid;
            entity.InsertTime = DateTime.Now;
            _userService.Add(entity, true);

            return(result);
        }
Exemple #2
0
 private Dictionary <long, string> GetPurviewMap()
 {
     return(_userPurviewService.GetPurviewMap());
 }