Dim tx1 As WinForm.ComboBox = e.Form.Controls("ComboBox1")
Dim user As String=tx1.text
Dim sss As String=e.Form.Controls("ComboBox2").text
Dim dept As String=e.Form.Controls("ComboBox3").text
Dim tx2 As WinForm.TextBox = e.Form.Controls("TextBox2")
Dim pows As String=tx2.text
Dim dl As WinForm.Button = e.Form.Controls("Button1")
Dim dt As DataTable=DataTables("用户表")
Dim dr As DataRow
Button1:
此主题相关图片如下:qq图片20190928093928.png
If user="" Then
MessageBox.show("请输入用户名称!","提示",MessageBoxButtons.OK,MessageBoxIcon.Error)
Return
Else
dr=dt.find("用户名称='" & user & "'")
If dr IsNot Nothing Then
If pows=dr("密码") Then
PopMessage("登陆成功","提示",PopIconEnum.Infomation,1)
e.Form.Close
dr("登陆时间")=Date.Now
dr("登陆账套")=sss
dr.Save()
usna=user
pwsd = pows
dpt = dept
syscmd.project.open(ProjectFile,sss)
Return
Else
MessageBox.show("密码错误","提示")
Return
End If
Else
MessageBox.show("用户不存在!","提示")
Return
End If
End If