e.Form.Strips.Clear()
'加载数据
Functions.Execute("数据加载",DataTables("客流信息"),"填写用户","填写部门","(日期='" & Date.Today & "')",True,e.Form,e.Form.Controls("SplitContainer2"),20,"分页工具栏1")
'设置按钮权限
Functions.Execute("按钮权限",e.Form)
'设置字段权限
Functions.Execute("字段控制",Tables("客流信息"))
'生成目录树
Dim tr As WinForm.TreeView = e.Form.Controls("TreeView1")
tr.BuildTree("客流信息", "门店名称")
tr.Nodes.Insert("显示所有数据",0)
'绘制窗口菜单
Functions.Execute("绘制窗口菜单",e.Form.Name,e.Form,e.form.Controls("Panel1"))
'禁用复制粘贴功能
DataTables("客流信息").AllowClipBoard = False
If _UserRoles = "系统管理员"
DataTables("客流信息").AllowClipBoard = True
End If
'省直辖市,地级市 字典设置
Dim cmd As New SQLCommand
Dim dt As DataTable
cmd.ConnectionName = DataSource
cmd.CommandText = "S ELECT 省直辖市,地级市 F rom {行政区域}"
dt = cmd.ExecuteReader()
Dim tb As New DropTreeBuilder
tb.SourceTable = dt'指定目录树表
tb.TreeCols = "省直辖市|地级市" '指定用于生成目录树的列
tb.SourceCols = "省直辖市|地级市" '指定数据来源列
tb.ReceiveCols = "省直辖市|地级市" '指定数据接收列
Tables("客流信息").Cols("省直辖市").DropTree = tb.Build()
'区域名称 门店名称 字典设置
Dim cmd1 As New SQLCommand
Dim dt1 As DataTable
cmd1.ConnectionName = DataSource
cmd1.CommandText = "SE LECT 区域名称,地区名称,门店名称 Fr om {组织架构}"
dt1 = cmd1.ExecuteReader()
Dim tb1 As New DropTreeBuilder
tb1.SourceTable = dt1 '指定目录树表
tb1.TreeCols = "区域名称|地区名称|门店名称" '指定用于生成目录树的列
tb1.SourceCols = "区域名称|地区名称|门店名称" '指定数据来源列
tb1.ReceiveCols = "区域名称|地区名称|门店名称" '指定数据接收列
Tables("客流信息").Cols("区域名称").DropTree = tb1.Build()
'关闭交叉统计中直接统计后台数据的功能
Tables("客流信息").AllowBackgroundStatistics = False
'设置数据字典
Dim dr As DataRow
For Each c As Col In Tables("客流信息").Cols
dr = DataTables("公共字典").sqlFind("[表名] = '客流信息' And [列名] = '" & c.Name & "'")
If dr IsNot Nothing Then
c.ComboList = dr("项目名称")
End If
Next
'设置分页条数的下拉选择框
e.Form.Strips("分页工具栏1").Items.InsertControl("PageRows",e.Form.Controls("Combobox1"),2)