各位老师、大咖们:
一个表,设定表事件中,只有登陆者才能修改自己的一行。这个没有出现问题。我绑定表作了录入窗口,窗口中有一个查找TextBox17,便登陆者登陆后,这个查找文件框不能输入,开发者可以输入。
窗口的Enter事件代码:
If e.Sender.Name.SubString(0,4) = "_cmb" Then '如果名称符合
Dim cmb As WinForm.ComboBox = e.Sender
If cmb.Items.Count > 0 Then '如果已经设置了项目
Return '则返回
End If
Dim t As Table = cmb.BindTable '获得绑定的Table
Dim c As Col = cmb.BindCol '获得绑定的Col
Dim dr As DataRow = DataTables("组合框代码").Find("[表] = '" & t.Name & "' And [列] = '" & c.Name & "'")
If dr IsNot Nothing Then '如果在项目表找到对应的行
cmb.Combolist = dr("列表项目") '则设置列表项目
End If
End If
Dim ctl As WinForm.Control = e.Sender
Dim r As Row = Tables("制造质量管理").Current
If r IsNot Nothing Then
If User.Name = "开发者" Then
ctl.ReadOnly = BooleanEnum.False '允许编辑
Else
If User.Name = r("检验员") Then
ctl.ReadOnly = BooleanEnum.False '允许编辑
Else
ctl.ReadOnly = BooleanEnum.True '禁止编辑
End If
End If
End If
TextBox17的Textchanged事件代码:
Dim txt As String = e.Form.Controls("TextBox17").Text
Dim tbl As Table = Tables("制造质量记录_Table1")
If txt = "" Then
tbl.Filter = ""
Else
txt = "'%" & txt & "%'"
tbl.Filter = "底盘号 Like " & txt & " Or 发动机号 Like " & txt & " Or 序号 Like " & txt & " Or 检验岗 Like " & txt
End If
求助!