Foxtable(狐表)用户栏目专家坐堂 → 用户登录


  共有8332人关注过本帖树形打印复制链接

主题:用户登录

帅哥哟,离线,有人找我吗?
Hyphen
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐神 帖子:5015 积分:25363 威望:0 精华:0 注册:2015/8/18 9:21:00
  发帖心情 Post By:2016/3/19 9:36:00 [显示全部帖子]



 回到顶部
帅哥哟,离线,有人找我吗?
Hyphen
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐神 帖子:5015 积分:25363 威望:0 精华:0 注册:2015/8/18 9:21:00
  发帖心情 Post By:2016/3/19 10:00:00 [显示全部帖子]

Dim UserName As String = e.Form.Controls("UserName").Value
Dim cmd As New SQLCommand
Dim dt As DataTable
Dim dr As DataRow
cmd.Con nection Name = "User"
If UserName = ""  Then
    Messagebox.show("请选择用户!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    Return
End If
cmd.CommandText = "Sel ect * From {Users} Wh ere [Name] = '" & UserName & "'"
dt = cmd.ExecuteReader
If dt.DataRows.Count = 0 Then
    Messagebox.show("此用户不存在!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    Return
End If
dr = dt.DataRows(0)
If e.Form.Controls("PassWord").Value = dr("Password") Then
    _UserName = UserName
    _UserGroup = dr("Group")
    Dim fdr As DataRow =DataTables("项目名称").find("项目名称 = '" & e.Form.Controls("账套").Value & "'")
    If fdr IsNot Nothing
        Dim dts As new List(Of String)
        For Each dt1 As DataTable In DataTables
            If dt1.C Then
                dts.Add(dt1.name)
            End If
        Next
        Dim glfs As new List(Of String)
        For Each re As Relation In Relations
            If not glfs.Contains(Re.ParentTable.Name) Then glfs.Add(Re.ParentTable.Name)
            If not glfs.Contains(Re.ChildTable.Name) Then glfs.Add(Re.ChildTable.Name)
        Next
        Dim n As Integer
        For Each dt1 As String In dts
            If not glfs.Contains(dt1)  Then
                DataTables.unLoad(dt1)
            End If
        Next
        DataTables.unLoad(String.Join("|",glfs.ToArray()))
        Connections.Delete("项目数据")
        Connections.Add("项目数据", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & ProjectPath & fdr("数据源") & ";Persist Security Info=False")
        For Each dt1 As String In dts
            DataTables.Load(dt1)    
        Next
    End If
    e.Form.Close
Else
    Messagebox.show("密码错误!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If

 回到顶部
帅哥哟,离线,有人找我吗?
Hyphen
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐神 帖子:5015 积分:25363 威望:0 精华:0 注册:2015/8/18 9:21:00
  发帖心情 Post By:2016/5/4 8:40:00 [显示全部帖子]


 回到顶部