Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
        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();
 }