Tables("user").Visible = (User.Type <> UserTypeEnum.User ) If User.Type = UserTypeEnum.User Then For Each dr As DataRow In DataTables("user").Select("分组名 = '" & User.Group & "'" ) If dr.IsNull("列名") Then Tables(dr("表名")).Visible = Not dr("不可见") Tables(dr("表名")).AllowEdit = Not dr("不可编辑") For Each t As Table In Tables If t.Name.EndsWith("." & dr("表名")) Then t.Visible = Not dr("不可见") t.AllowEdit = Not dr("不可编辑") Exit For End If Next Else Tables(dr("表名")).Cols(dr("列名")).Visible = Not dr("不可见") Tables(dr("表名")).Cols(dr("列名")).AllowEdit = Not dr("不可编辑") For Each t As Table In Tables If t.Name.EndsWith("." & dr("表名")) AndAlso t.cols.Contains(dr("列名")) Then t.Cols(dr("列名")).Visible = Not dr("不可见") t.Cols(dr("列名")).AllowEdit = Not dr("不可编辑") End If Next End If Next End If