Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共3 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:狐狸爸爸,这里我用的SQL server中的表,表的不可见用truej是不是就不对了,那用SQL server的0,1怎么不处理

1楼
dd-zdh 发表于:2011/5/8 14:57:00

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 {用户表} Where [用户名] = '" & UserName & "'"
dt = cmd.ExecuteReader
dr = dt.DataRows(0)
If e.Form.Controls("PassWord").Value = trim(dr("密码")) Then
    _UserName = UserName
    _UserGroup = dr("部门")
 
'//执行授权表
For Each t As Table In Tables '显示所有表和列
    t.Visible = True
    t.AllowEdit = True
    For Each c As Col In t.Cols
        c.Visible = True
        c.AllowEdit = True
    Next
Next
'Tables("授权表").Visible = (User.Type <> UserTypeEnum.User )
'If  User.Type <> UserTypeEnum.User Then
'    Return
'End If
For Each dr1 As DataRow In DataTables("授权表").Select("用户名= '" & User.Name & "'" )
    If dr1.IsNull("列名") Then
        For Each t As Table In Tables
           If t.DataTable.Name = dr1("表名") Then
                t.Visible = Not dr1("不可见")
                t.AllowEdit = Not dr1("不可编辑")
            End If
        Next
    Else
        For Each t As Table In Tables
            If t.DataTable.Name = dr1("表名") Then
                For Each c As Col In t.Cols
                    If c.Name = dr1("列名") Then
                        c.Visible = Not dr1("不可见")
                        c.AllowEdit = Not dr1("不可编辑")
                    End If
                Next
            End If
        Next
    End If
Next


    e.Form.Close
Else
    Messagebox.show("密码错误!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If

 

 

 

关键就是TRUE  和0,1的问题

2楼
dd-zdh 发表于:2011/5/8 14:59:00

t.Visible = Not dr1("不可见")
t.AllowEdit = Not dr1("不可编辑")

 

c.Visible = Not dr1("不可见")
                       

c.AllowEdit = Not dr1("不可编辑")

这四句话是重点,不会处理

3楼
狐狸爸爸 发表于:2011/5/8 16:41:00

到了FoxTable,就都是True和False了,没有0和1了。

出于稳妥考虑,你将用户表直接加载到foxtable,看看相关列的值,到底是True和False,还是0和1.

共3 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .01563 s, 2 queries.