Dim b As String = e.Form.Controls("用户名输入框").value
Dim c As String = e.Form.Controls("密码输入框").value
Dim d As String = e.Form.Controls("用户角色输入框").value
Dim r As String = Tables("用户管理_用户管理").Current("用户名称")
Dim s As String = Tables("用户管理_用户管理").Current("用户角色")
If b = "" Then
MessageBox.Show("请输入用户名","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
If c = "" Then
MessageBox.Show("请输入密码","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
If e.Form.Controls("密码确认框").value = "" Then
MessageBox.Show("请确认密码","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
If d = "" Then
MessageBox.Show("请初步确定用户权限级别","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
If c.length < 6 Then
MessageBox.Show("密码长度不得小于6位","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
If c.length > 16 Then
MessageBox.Show("密码长度不得超过16位","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
If e.Form.Controls("密码确认框").value <> c Then
MessageBox.Show("2次输入的密码不相同","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
Dim a As new SQLCommand
a.C
MessageBox.show(b)
MessageBox.show(c)
MessageBox.show(d)
MessageBox.show(r)
MessageBox.show(s)
If d <> s Then
Dim pp() As String = d.Split(",")
a.CommandText = "Select * from {权限表}"
Dim y As DataTable = a.ExecuteReader(True)
For Each qq As DataRow In y.DataRows
For Each p As String In pp
If qq(p) = True Then
qq(r) = True
Exit For
End If
Next
Next
y.save()
End If
If b = r Then
a.CommandText = "Select Count(*) From {用户} Where 用户名称 = '" & b & "'"
Dim t As DataTable = a.ExecuteReader(True)
t.DataRows(0)("用户密码") = c
t.save()
Else
a.CommandText = "Select Count(*) From {用户} Where 用户名称 = '" & r & "'"
Dim u As DataTable = a.ExecuteReader(True)
u.DataRows(0)("用户密码") = c
If d <> s Then
u.DataRows(0)("用户角色") = d
End If
Dim Builder As New ADOXBuilder("new")
Builder.Open()
With Builder.Tables("权限表")
.RenameColumn(r,b)
End With
Builder.Close()
u.save()
End If
此主题相关图片如下:qq截图20130607114240.jpg