
Partial Class XrManage_ChangePassWord
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            lblUserName.Text = BaseFunction.SiteUser.GetLoginUserName
        End If
    End Sub

    Protected Sub imgSave_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imgSave.Click
        If txtOldPassWord.Text.Length > 0 Then
            If txtNewPassWord.Text = txtNewPassWord2.Text Then
                Dim SiteKey As String = BaseFunction.PublicMethod.GetApplication("SiteKey")
                Dim UserID As Integer = CType(BaseFunction.PublicMethod.DESDecrypt(Request.Cookies("M_UserID").Value, SiteKey), Integer)
                Dim mUser As New DB_UserModular.clsXrenUser
                If mUser.ChangePassWord(UserID, BaseFunction.PublicMethod.MD5(txtNewPassWord.Text, 16)) Then
                    Response.Write("<script>alert('密码修改成功！退出后生效！')</script>")
                Else
                    Response.Write("<script>alert('密码修改失败！')</script>")
                End If

            Else
                Response.Write("<script>alert('两次密码输入不符！')</script>")
            End If
        Else
            Response.Write("<script>alert('请输入原有密码！')</script>")
        End If

    End Sub
End Class
