Dim UserName As String = e.Form.Controls("UserName").Value
Dim cmd As New SQLCommand
Dim dt As DataTable
Dim dr As DataRow
cmd.C
If UserName = "" Then
Messagebox.show("请选择用户!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
cmd.CommandText = "Select * From {newmoo_User} Where [userName] = '" & UserName & "'"
dt = cmd.ExecuteReader
If dt.DataRows.Count = 0 Then
Messagebox.show("此用户不存在!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
dr = dt.DataRows(0)
If System.Web.Security.FormsAuthentication.HashpasswordForStoringInConfigFile(e.Form.Controls("password").Value, "MD5") = dr("password").Trim() Then
_UserName = username
_UserGroup = dr("Group")
e.Form.Close
Else
Messagebox.show("密码错误!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
Dim dr1 As DataRow
dr1 = DataTables("users").Find("id= " & "'" )
If dr1 IsNot Nothing '如果找到, 则设置各列内容
dr("业务员")= dr1("username")
Else
End If
DataTables("订单").LoadFilter = "业务员 = '" & _UserName & "'"
DataTables("订单").Load()