示例#1
0
        /// <summary>
        ///修改用户密码
        /// </summary>
        public ResponseModel UpdateUserPassWord(EditUserPwd edituserpwd)
        {
            var users = this.GetOneUsers(c => c.F_UserId == edituserpwd.F_UserId);

            if (users == null)
            {
                return new ResponseModel {
                           code = 0, result = "该用户不存在"
                }
            }
            ;
            users.F_Password = edituserpwd.F_NewPassword;
            _db.Users.Update(users);
            int i = _db.SaveChanges();

            if (i > 0)
            {
                return new ResponseModel {
                           code = 200, result = "密码修改成功"
                }
            }
            ;
            return(new ResponseModel {
                code = 0, result = "密码修改失败"
            });
        }
示例#2
0
 public JsonResult UserUpdatePwd(EditUserPwd edituserpwd)
 {
     if (string.IsNullOrEmpty(edituserpwd.F_NewPassword))
     {
         return(Json(new ResponseModel {
             code = 0, result = "请输入新密码!"
         }));
     }
     return(Json(_usersService.UpdateUserPassWord(edituserpwd)));
 }