(这个是我设置-新加按钮的代码)
Tables(e.Form.TableName).AddNew()
Dim aa As WinForm.Form = Forms("版型信息")
If aa.Opened = False Then
aa.Open()
End If
(删除按钮的代码)
Dim aa As WinForm.Form = Forms("版型信息")
Dim lvw As WinForm.ListView = e.Form.Controls("ListView1")
Dim vr As WinForm.ListViewRow = lvw.Current '获取ListView的当前行
If vr Is Nothing Then '如果不存在当前行,也就是内有选定任何一行
Return
End If
Dim jk As Integer
Integer.TryParse(vr("_Identify"),jk)
Dim dr As DataRow = Tables("版型库").DataTable.Find("_Identify = '" & jk & "'")
Dim ps As Integer = Tables("版型库").FindRow(dr)
If dr IsNot Nothing AndAlso dr("设计师") = user.Name AndAlso dr("审核") = False Then
dr.Delete '从DataTable删除行
vr.Delete '从ListView删除行
Else
PopMessage("没权限删除",,,7)
End If
(修改按钮的代码)
Dim aa As WinForm.Form = Forms("版型信息")
Dim lvw As WinForm.ListView = e.Form.Controls("ListView1")
Dim vr As WinForm.ListViewRow = lvw.Current '获取ListView的当前行
If vr Is Nothing Then '如果不存在当前行,也就是内有选定任何一行
Return
End If
Dim jk As Integer
Integer.TryParse(vr("_Identify"),jk)
Dim dr As DataRow = Tables("版型库").DataTable.Find("_Identify = '" & jk & "'")
Dim ps As Integer = Tables("版型库").FindRow(dr)
If dr IsNot Nothing AndAlso dr("设计师") = user.Name AndAlso dr("审核") = False Then
If ps >= 0 Then
Tables("版型库").Position = ps
End If
If aa.Opened = False Then
aa.Open()
End If
Else
PopMessage("没权限修改",,,7)
End If
(保存按钮的代码)
Dim dd As Row = CurrentTable.Current
If dd("样板") = Nothing OrElse dd("成衣图片") = Nothing Then
PopMessage("添加文件后保存",,,7)
Else
e.Form.Close()
Functions.Execute("生成版型")
End If
我给按钮设置了权限,但是为什么,只有拥有权限的人才可以新增,删除,修改, 但是我在测试应用窗口的已拥有权限的身份去新增文件,页面不显示,也删除不了, 这是为什么呢?