.NET Framework 版本:4.0.30319.18063
Foxtable 版本:2019.11.3.1
错误所在事件:自定义函数editpwd
详细错误信息:
调用的目标发生了异常。
已添加了具有相同键的项。
老师,试过,在点击确认后,网页未刷新完成,再点击确认就会有这样的错误!
Dim wb As New weui
wb.AddPageTitle("","pageheader","2020","上格兰格春节联欢晚会")
Select Case e.Path
Case "wefox"
Functions.Execute("wefox",e)
Case "getBrands.htm"
Dim pps As String = DataTables("人员表").SQLGetComboListString("部门","公司='" & e.PostValues("公司") & "'")
e.WriteString(pps)
Case "logon.htm",""
Dim path As String = e.Path
If path = Nothing Then path = "logon.htm"
Functions.Execute(path.replace(".htm",""),e)
Case Else
Functions.Execute(e.path.replace(".htm",""),e)
End Select
'~~~~~~~~以下为函数
Dim e As RequestEventArgs = args(0)
Dim wb As New weui
wb.AddPageTitle("","pageheader","2020","上格兰格春节联欢晚会")
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dim pkey As Integer = e.GetValues("key")
If e.PostValues.count = 0 Then
wb.AddForm("","editpwd1","editpwd.htm")
With wb.AddInputGroup("editpwd1","ipg1","更改密码")
If pkey > 0 Then
Dim fr As DataRow = DataTables("人员表").SQLFind("序号 = " & pkey)
If fr IsNot Nothing Then
.AddInput("name","姓名","text").Value = fr("姓名")
Else
.AddInput("name","姓名","text")
End If
Else
.AddInput("name","姓名","text")
End If
.AddInput("opwd","旧 密 码","password").Placeholder = "第一次设置密码时为空"
.AddInput("Npwd1","新 密 码","password")
.AddInput("Npwd2","重复密码","password")
End With
With wb.AddButtonGroup("editpwd1","btg1",True)
.Add("btn1", "确认", "submit")
.Add("btn1", "返回","","logon.htm").Kind = 1
End With
Else
Dim fr As DataRow = Functions.Execute("fir",e.PostValues("name") )
If fr Is Nothing Then
With wb.AddMsgPage("","msgpage","提示", "您不是本公司的员工或您输入的用户名错误!")
.icon = "Warn" '改变图标
.AddButton("btn1","返回").Attribute = ""
End With
Else
If fr.IsNull("pwd") = False Then
If e.PostValues("opwd") <> fr("pwd") Then
With wb.AddMsgPage("","msgpage","密码错误", "您输入的旧密码错误!")
.icon = "Warn" '改变图标
.AddButton("btn1","返回").Attribute = ""
End With
End If
End If
If e.PostValues("npwd1") = e.PostValues("npwd2") Then
fr("pwd") = e.PostValues("npwd2")
fr.Save
With wb.AddMsgPage("","msgpage","修改提示", "密码修改完成!")
.AddButton("btn1","返回","logon.htm")
End With
Else
With wb.AddMsgPage("","msgpage","输入错误", "您二次输入的密码不一致!")
.icon = "Warn" '改变图标
.AddButton("btn1","返回").Attribute = ""
End With
End If
End If
End If
'wb.AddPageFooter("","pf1","").AddLink("返回登录","logon.htm")
e.WriteString(wb.Build) '生成网页