using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using DotNet.FrameWork.Data;
using System.Data.SqlClient;
using DotNet.FrameWork.Common.Encrypt;

namespace HteamDd.Web.ashx
{
    /// <summary>
    /// Dd_psw_ret 的摘要说明
    /// </summary>
    public class Dd_psw_ret : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            string useid = context.Request["userid"].ToString();
            string user_psw = context.Request["user_psw"].ToString();
            string update_psw = "update Dd_User set User_Passwd=@newpsw,User_OriginPsw=@ori_psw where User_ID=@id";
            SqlParameter[] parm = new SqlParameter[]{
                        new SqlParameter("@newpsw",Encrypt.EncryptPassword(user_psw,"MD5")),
                        new SqlParameter("@ori_psw",user_psw),
                        new SqlParameter("@id",useid)
            };
            try
            {
                 DbHelperSQL.ExecuteSql(update_psw, parm);
                 context.Response.Write("11");
            }
            catch
            {
                context.Response.Write("00");
            }

        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}