此主题相关图片如下:12.jpg
代码如下:
Dim tbl As Table = Tables("自动录入_Table1")
If e.KeyCode = Keys.Up Then
tbl.Position = tbl.Position - 1
e.Cancel = True
ElseIf e.KeyCode = Keys.Down Then
tbl.Position = tbl.Position + 1
e.Cancel = True
ElseIf e.KeyCode = Keys.Enter Then
If tbl.Current IsNot Nothing Then
If e.Control = False Then
' Select Case "obas_part_spec"
'Case "obas_part_spec"
For Each dr1 As DataRow In DataTables("授权表").Select("用户名 = '" & Vars("_UserName") & "'" )
If dr1("表名") = Tables("obas_part_spec").Name AndAlso dr1("只能编辑个人数据")=True Then
If Vars("_UserName") <> Tables("obas_part_spec").Current("user_no") Then
Messagebox.Show("你已经被限制只能编缉属于你自己的数据!,如有疑问,请与管理员联系","提示",MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
Dim r2 As Row = Tables("obas_part_spec").AddNew()
Tables("obas_part_spec").Current("part_no") = tbl.Current("part_no")
'Tables("obas_part_spec").Current("part_no") = tbl.Current("part_no") '单行写入的代码
'Tables("obas_part_spec").Current("料品名称") = tbl.Current("料品名称")
'Tables("obas_part_spec").Current("料品规格") = tbl.Current("料品规格")
'Tables("obas_part_spec").Current("料品归类") = tbl.Current("料品归类")
'Tables("obas_part_spec").Current("库存单位") = tbl.Current("库存单位")
End If
End If
If dr1("表名") = Tables("obas_part_spec").Name AndAlso dr1("只能编辑部门数据")=True Then
If Tables("obas_part_spec").Current.isnull("部门") Then
Return
ElseIf dr1("部门范围").indexof( Tables("obas_part_spec").Current("部门")) < 0 Then
Messagebox.Show("你已经被限制只能编缉属于你的部门数据!,如有疑问,请与管理员联系","提示",MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
Tables("obas_part_spec").AddNew()
Tables("obas_part_spec").Current("part_no") = tbl.Current("part_no")
'Tables("obas_part_spec").Current("part_no") = tbl.Current("part_no") '单行写入的代码
'Tables("obas_part_spec").Current("料品名称") = tbl.Current("料品名称")
'Tables("obas_part_spec").Current("料品规格") = tbl.Current("料品规格")
'Tables("obas_part_spec").Current("料品归类") = tbl.Current("料品归类")
'Tables("obas_part_spec").Current("库存单位") = tbl.Current("库存单位")
End If
End If
If dr1("表名") = Tables("obas_part_spec").Name AndAlso dr1("只能编辑组数据")=True Then
If Tables("obas_part_spec").Current.isnull("org_no") Then
Return
ElseIf dr1("可编辑组范围").indexof( Tables("obas_part_spec").Current("org_no")) < 0 Then
Messagebox.Show("你已经被限制只能编缉属于你组名数据!,如有疑问,请与管理员联系","提示",MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
Tables("obas_part_spec").AddNew()
Tables("obas_part_spec").Current("part_no") = tbl.Current("part_no") '单行写入的代码
'Dim r2 As Row = Tables("obas_part_spec").AddNew()
'r2("part_no") ="123456"
'tbl.Current("part_no")
'Tables("obas_part_spec").Current("part_no") = tbl.Current("part_no") '单行写入的代码
'Tables("obas_part_spec").Current("料品名称") = tbl.Current("料品名称")
'Tables("obas_part_spec").Current("料品规格") = tbl.Current("料品规格")
'Tables("obas_part_spec").Current("料品归类") = tbl.Current("料品归类")
'Tables("obas_part_spec").Current("库存单位") = tbl.Current("库存单位")
End If
End If
Next
'End Select
Else
For Each r1 As Row In Tables("自动录入_Table1").GetCheckedRows
Dim r2 As Row = Tables("obas_part_spec").AddNew()
r2("part_no") = r1("part_no")
'r2("料品名称") = r1("料品名称")
'r2("料品归类") = r1("料品归类")
'r2("料品规格") = r1("料品规格")
'r2("库存单位") = r1("库存单位")
Next
End If
End If
e.Cancel = True
e.Form.Close()
End If
If e.KeyCode = Keys.Escape
e.Form.Close()
End If