public object Post(ChangePsw request) { IAuthRepository authRepository = new OrmLiteAuthRepository(DbFactory); IUserAuthRepository userAuthRepository = authRepository.AsUserAuthRepository(GetResolver()); var user = userAuthRepository.GetUserAuth(request.Id.ToString()); userAuthRepository.UpdateUserAuth(user, user, request.PassWord); return true; }
public string ChangePsw(ChangePsw changePsw) { User user = this.GetSessionCurrentUser(); user.Password = FormsAuthentication.HashPasswordForStoringInConfigFile(changePsw.NewPsw, "MD5"); dbContext.Entry(user).State = System.Data.Entity.EntityState.Modified; dbContext.SaveChanges(); // 更新内存 this.Update(1); return("<p class='alert alert-success'>您已成功修改密码</p>"); }
private void ChangePsw_Click(object sender, RoutedEventArgs e) { ChangePsw.GetObject().Goin(); }