Beispiel #1
0
        protected override void CompleteBeforeSubmitPost(UserAccountViewModel entity, PostData <UserAccountViewModel> postData, bool isNew)
        {
            var currentId = Convert.ToInt32(SessionHelper.User.UserId);

            entity.CreateBy = currentId;
            entity.Password = _passwordHasher.HashPassword(null, entity.UserName.ToLower() + entity.Password);
        }
Beispiel #2
0
        protected override EntityUpdateFiledsInfo GetEntityUpdateFiledsInfo(UserAccountViewModel entity)
        {
            var preventItems = new List <string>();

            if (entity.Password == "$$default")
            {
                preventItems.Add("Password");
            }
            return(new EntityUpdateFiledsInfo(preventItems));
        }