private User GetUser() { User user = UserCommon.FindById(_id, QueryLevel.Single); if (user.IsEmpty()) { throw new NotFoundObjectException(typeof(User), _id); } return(user); }
private bool ExistsSameAccount(User obj) { User target = UserCommon.FindById(obj.Account.Id, QueryLevel.HoldSingle); if (target.IsEmpty()) { return(false); } if (target.Equals(obj)) { return(false); } return(true); }
protected override void RaiseImplement() { var user = UserCommon.FindById(this.Id, QueryLevel.None); if (user.IsEmpty()) { return; } //记录数据,留待恢复使用 this.Name = user.Name; this.MobileNumber = user.MobileNumber; this.AccountName = user.Account.Name; this.Password = user.Account.Password; this.RoleIds = user.Account.Roles.Select((t) => t.Id).ToArray(); this.Sex = user.Sex; var cmd = new DeleteUser(this.Id); cmd.Execute(); }