Dim Parts() As String = e.Form.Text.Split("-")
Dim txb1 As WinForm.TextBox = e.Form.Controls("TextBox1")
Dim txb2 As WinForm.TextBox = e.Form.Controls("TextBox2")
Dim txb3 As WinForm.TextBox = e.Form.Controls("TextBox3")
Dim OldUserName As String
OldUserName = Parts(Parts.Length -1)
Dim dr As DataRow =DataTables("用户表").Find("用户名称='" & OldUserName & "'")
Dim dr2 As DataRow=DataTables("用户表").Find("用户名称='" & txb1.text & "'" )
If dr2("_Identify")<> dr("_Identify")Then
MessageBox.show("已存在相同用户!","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning)
Return
End If
Dim syb As WinForm.RadioButton = e.Form.Controls("RadioButton1")
Dim ymb As WinForm.RadioButton = e.Form.Controls("RadioButton2")
Dim yuga As WinForm.RadioButton = e.Form.Controls("RadioButton3")
Dim jili As WinForm.RadioButton = e.Form.Controls("RadioButton4")
If txb3.text<>txb2.text Then
MessageBox.show("密码输入不一致!","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning)
Return
End If
dr("用户名称")=txb1.text
dr("密码")=txb2.text
If syb.Checked=True Then
dr("部门")="销售部"
Else
If ymb.Checked=True Then
dr("部门")="业务部"
End If
End If
If yuga.Checked=True Then
dr("职务")="员工"
Else
If jili.Checked=True Then
dr("职务")="经理"
End If
End If
dr.Save()
If Forms("用户管理").Opened Then
usna="admin"
Else
usna=txb1.text
End If
e.Form.close()