Dim fm As winform.Form = Forms("password")
Dim UserId As String = fm.controls("textbox1").text
Dim cmd As new SQLCommand
Dim dt As DataTable
Dim dr As DataRow
cmd.Con necti
If UserId = "" Then
Messagebox.Show("请填写用户帐号!","系统提示",Messageboxbuttons.OK,Messageboxicon.information)
Return
End If
If fm.controls("textbox3").text = "" Or fm.controls("textbox4").text = "" Then
Messagebox.Show("请填写新密码!","系统提示",Messageboxbuttons.OK,Messageboxicon.information)
Return
End If
If fm.controls("textbox3").text <> fm.controls("textbox4").text Then
Messagebox.Show("你填写的两次密码不一致!","系统提示",Messageboxbuttons.OK,Messageboxicon.information)
Return
End If
cmd.CommandText = "Sel ect * Fr om {user} wh ere [PersonId] = '" & UserId & "'"
dt = cmd.ExecuteReader
dr = dt.DataRows(0)
If dr("password") <> fm.controls("textbox2").text Then
Messagebox.Show("旧密码错误!","系统提示",Messageboxbuttons.OK,Messageboxicon.information)
Return
End If
Dim NewPassword As String = fm.controls("textbox3").text
cm d.CommandText = "Upd ate {User} S et [password] = '" & NewPassword & "' W here [PersonId]= '" & UserId & "'"
Messagebox.Show("密码更新成功,请牢记新密码!","系统提示",Messageboxbuttons.OK,Messageboxicon.information)
fm.Close