If User.Name <> "开发者" Then
Select Case e.Col.name
Case "库存"
e.cancel = True
e.Continue = False '取消后续同类操作
Messagebox.Show("系统自动生成,不能填写和修改!","提示",MessageBoxButtons.OK, MessageBoxIcon.Information) 这一段没问题
Case "日期","物品名称","单位","规格型号" 如果是总务主任或保管员这四列允许编辑,但总务主任编辑不了。
If User.IsRole("保管员") = False OrElse user.isrole("总务主任") = False Then
e.cancel = True
e.Continue = False '取消后续同类操作
Messagebox.Show("只有管理人员才能填写,修改!","提示",MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
请老师给看看代码有什么问题呢
Case "入库_供货单位","入库_数量","入库_过期日期"
If e.Row.isnull("出库_出库人") = False OrElse e.Row.isnull("出库_数量") = False Then
If user.isrole("保管员") = False Then
e.cancel = True
e.Continue = False '取消后续同类操作
Messagebox.Show("只有管理员或本班班主任才能填写,修改!","提示",MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End If
Case "出库_出库人","出库_数量"
If e.Row.isnull("入库_供货单位") = False OrElse e.Row.isnull("入库_数量") = False Then
If user.isrole("总务主任") = False Then
e.cancel = True
e.Continue = False '取消后续同类操作
Messagebox.Show("只有总务主任才能填写,修改!","提示",MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End If
End Select
End If