Beispiel #1
0
        public GTUser(Name name, Email email, string password)
        {
            Name     = name;
            Email    = email;
            Password = password;
            Status   = EnumUserStatus.InAnalysis;

            new AddNotifications <GTUser>(this)
            .IfNullOrInvalidLength(o => o.Password, 6, 32, Message.X2_Required_Between.ToFormat(Message.Password, "6", "32"));

            if (IsValid())
            {
                Password = password.ConvertToMD5();
            }
        }
Beispiel #2
0
        /// <summary>
        /// 修改用户状态
        /// </summary>
        /// <param name="IdList"></param>
        /// <param name="Status"></param>
        /// <returns></returns>
        public ActionResult UpdateStatus(IList <Guid> IdList, EnumUserStatus Status)
        {
            foreach (var Id in IdList)
            {
                var model = UserService.Get(Id);
                if (model == null)
                {
                    continue;
                }

                model.Status = Status;
                UserService.SaveOrUpdate(model);

                if (model.Id == this.CurrentUser.Id)
                {
                    this.CurrentUser = model;
                }
            }
            return(new BetterJsonResult(null, true));
        }