老师,完整代码如下:
Dim cnt1 As Integer = DataTables("采购申请明细").SQLCompute("Count(审核状态)","需审核人 = '" & _UserName & "' and 审核状态 = '待审核'")
If cnt1 > 0 Then
Forms("导航窗口").Controls("TopicBar1").Pages("采购申请业务").Links("采购申请审核").text = "采购申请审核(" & cnt1 & ")"
Else
Forms("导航窗口").Controls("TopicBar1").Pages("采购申请业务").Links("采购申请审核").text = "采购申请审核"
End If
Dim cnt5 As Integer = DataTables("采购申请明细").SQLCompute("Count(审核状态)","需审核人 = '" & _UserName & "' and 审核状态 = '驳回'")
If cnt5 > 0 Then
Forms("导航窗口").Controls("TopicBar1").Pages("采购申请业务").Links("采购申请驳回").text = "采购申请驳回(" & cnt5 & ")"
Else
Forms("导航窗口").Controls("TopicBar1").Pages("采购申请业务").Links("采购申请驳回").text = "采购申请驳回"
End If
Dim cnt2 As Integer = DataTables("操作工工时").SQLCompute("Count(审核状态)","需审核人 = '" & _UserName & "' and 审核状态 = '待审核'")
If cnt2 > 0 Then
Forms("导航窗口").Controls("TopicBar1").Pages("工时业务处理").Links("工时补助审核").text = "工时补助审核(" & cnt2 & ")"
Else
Forms("导航窗口").Controls("TopicBar1").Pages("工时业务处理").Links("工时补助审核").text = "工时补助审核"
End If
Dim cnt7 As Integer = DataTables("操作工工时").SQLCompute("Count(审核状态)","需审核人 = '" & _UserName & "' and 审核状态 = '驳回'")
If cnt7 > 0 Then
Forms("导航窗口").Controls("TopicBar1").Pages("工时业务处理").Links("工时补助驳回").text = "工时补助驳回(" & cnt7 & ")"
Else
Forms("导航窗口").Controls("TopicBar1").Pages("工时业务处理").Links("工时补助驳回").text = "工时补助驳回"
End If
Dim cnt3 As Integer = DataTables("管理层杂工总表").SQLCompute("Count(审核状态)","需审核人 = '" & _UserName & "' and 审核状态 = '待审核'")
If cnt3 > 0 Then
Forms("导航窗口").Controls("TopicBar1").Pages("工时业务处理").Links("管理工时批准").text = "管理工时批准(" & cnt3 & ")"
Else
Forms("导航窗口").Controls("TopicBar1").Pages("工时业务处理").Links("管理工时批准").text = "管理工时批准"
End If
Dim cnt4 As Integer = DataTables("异常申请记录").SQLCompute("Count(审核状态)","需审核人 = '" & _UserName & "' and 审核状态 = '待审核' and 操作类型 = '修磨处理'")
If cnt4 > 0 Then
Forms("导航窗口").Controls("TopicBar1").Pages("刀具业务过程").Links("刀具修磨审核").text = "刀具修磨审核(" & cnt4 & ")"
Else
Forms("导航窗口").Controls("TopicBar1").Pages("刀具业务过程").Links("刀具修磨审核").text = "刀具修磨审核"
End If
Dim cnt6 As Integer = DataTables("异常申请记录").SQLCompute("Count(审核状态)","需审核人 = '" & _UserName & "' and 审核状态 = '驳回'")
If cnt6 > 0 Then
Forms("导航窗口").Controls("TopicBar1").Pages("刀具业务过程").Links("刀具过程驳回").text = "刀具过程驳回(" & cnt6 & ")"
Else
Forms("导航窗口").Controls("TopicBar1").Pages("刀具业务过程").Links("刀具过程驳回").text = "刀具过程驳回"
End If
Dim cnt8 As Integer = DataTables("异常申请记录").SQLCompute("Count(审核状态)","需审核人 = '" & _UserName & "' and 审核状态 = '待审核' and 操作类型 = '刀盘调试'")
If cnt8 > 0 Then
Forms("导航窗口").Controls("TopicBar1").Pages("刀具业务过程").Links("刀盘调试审核").text = "刀盘调试审核(" & cnt8 & ")"
Else
Forms("导航窗口").Controls("TopicBar1").Pages("刀具业务过程").Links("刀盘调试审核").text = "刀盘调试审核"
End If
Dim cnt9 As Integer = DataTables("刀具报废明细").SQLCompute("Count(目前状态)","需审核人 = '" & _UserName & "' and ([目前状态] = '驳回' or [目前状态] = '待审核'or [目前状态] = '转交')")
If cnt9 > 0 Then
Forms("导航窗口").Controls("TopicBar1").Pages("刀具业务过程").Links("刀具报废审核").text = "刀具报废审核(" & cnt9 & ")"
Else
Forms("导航窗口").Controls("TopicBar1").Pages("刀具业务过程").Links("刀具报废审核").text = "刀具报废审核"
End If
Dim cnt10 As Integer = DataTables("异常申请记录").SQLCompute("Count(审核状态)","需审核人 = '" & _UserName & "'and 审核状态 = '待审核' and 操作类型 = '再利用库'")
If cnt10 > 0 Then
Forms("导航窗口").Controls("TopicBar1").Pages("刀具业务过程").Links("再利用库审核").text = "再利用库审核(" & cnt10 & ")"
Else
Forms("导航窗口").Controls("TopicBar1").Pages("刀具业务过程").Links("再利用库审核").text = "再利用库审核"
End If
Dim cnt11 As Integer = DataTables("设备维保记录").SQLCompute("Count(节点状态)","[线别] = '" & _UserGroup & "'and [节点状态] = '维修进行中'And [计划确认] Is Null")
If cnt11 > 0 Then
Forms("导航窗口").Controls("TopicBar1").Pages("设备管理业务").Links("计划审核确认").text = "计划审核确认(" & cnt11 & ")"
Else
Forms("导航窗口").Controls("TopicBar1").Pages("设备管理业务").Links("计划审核确认").text = "计划审核确认"
End If
Dim cnt12 As Integer = DataTables("设备维保记录").SQLCompute("Count(节点状态)","[需审核人] = '"& _UserName &"' And ([节点状态] = '维保总结' or [节点状态] = '维修进行中'or [节点状态] = '待进行维修')")
If cnt12 > 0 Then
Forms("导航窗口").Controls("TopicBar1").Pages("设备管理业务").Links("设备维修记录").text = "设备维修记录(" & cnt12 & ")"
Else
Forms("导航窗口").Controls("TopicBar1").Pages("设备管理业务").Links("设备维修记录").text = "设备维修记录"
End If
Dim cnt13 As Integer = DataTables("设备维保记录").SQLCompute("Count(节点状态)","[线别] in ('" & _UserGroup.replace(",","','") & "') and ([节点状态] = '待设备验收' or [节点状态] = '设备验收中')")
If cnt13 > 0 Then
Forms("导航窗口").Controls("TopicBar1").Pages("设备管理业务").Links("设备验收操作").text = "设备验收操作(" & cnt13 & ")"
Else
Forms("导航窗口").Controls("TopicBar1").Pages("设备管理业务").Links("设备验收操作").text = "设备验收操作"
End If
Dim cnt14 As Integer = DataTables("生产异常停机").SQLCompute("Count(当前状态)","需审核人 = '" & _UserName & "' and 当前状态 = '待审核'")
If cnt14 > 0 Then
Forms("导航窗口").Controls("TopicBar1").Pages("生产过程异常").Links("生产异常处理").text = "生产异常处理(" & cnt14 & ")"
Else
Forms("导航窗口").Controls("TopicBar1").Pages("生产过程异常").Links("生产异常处理").text = "生产异常处理"
End If
Dim cnt15 As Integer = DataTables("生产异常停机").SQLCompute("Count(当前状态)","需审核人 = '" & _UserName & "' and 当前状态 = '驳回'")
If cnt15 > 0 Then
Forms("导航窗口").Controls("TopicBar1").Pages("生产过程异常").Links("生产异常驳回").text = "生产异常驳回(" & cnt15 & ")"
Else
Forms("导航窗口").Controls("TopicBar1").Pages("生产过程异常").Links("生产异常驳回").text = "生产异常驳回"
End If
Dim cnt16 As Integer = DataTables("新刀试刀申请").SQLCompute("Count(当前状态)","需审核人 = '" & _UserName & "' and 当前状态 = '待审核'")
If cnt16 > 0 Then
Forms("导航窗口").Controls("TopicBar1").Pages("刀具业务过程").Links("试刀申请处理").text = "试刀申请处理(" & cnt16 & ")"
Else
Forms("导航窗口").Controls("TopicBar1").Pages("刀具业务过程").Links("试刀申请处理").text = "试刀申请处理"
End If
Dim cnt17 As Integer = DataTables("联络通知单").SQLCompute("Count(当前状态)","需审核人 = '" & _UserName & "' and 当前状态 = '驳回'")
If cnt17 > 0 Then
Forms("导航窗口").Controls("TopicBar1").Pages("通知单据审核").Links("单据明细驳回").text = "单据明细驳回(" & cnt17 & ")"
Else
Forms("导航窗口").Controls("TopicBar1").Pages("通知单据审核").Links("单据明细驳回").text = "单据明细驳回"
End If
Dim cnt18 As Integer = DataTables("联络通知单").SQLCompute("Count(当前状态)","需审核人 = '" & _UserName & "' and 当前状态 = '待审核'")
If cnt18 > 0 Then
Forms("导航窗口").Controls("TopicBar1").Pages("通知单据审核").Links("单据明细审核").text = "单据明细审核(" & cnt18 & ")"
Else
Forms("导航窗口").Controls("TopicBar1").Pages("通知单据审核").Links("单据明细审核").text = "单据明细审核"
End If
If _UserGroup Like "*质量部*" Or _UserGroup Like "*配刀库*" Then
Dim cnt19 As Integer = DataTables("来料待检明细").SQLCompute("Count(检测状态)","([检测状态] = '待检测' or [检测状态] = '驳回'or [检测状态] = '转交') and '" & _UserGroup & "' Like '%'+[检测部门]+'%'")
If cnt19 > 0 Then
Forms("导航窗口").Controls("TopicBar1").Pages("质量检测处理").Links("来料检测审核").text = "来料检测审核(" & cnt19 & ")"
Else
Forms("导航窗口").Controls("TopicBar1").Pages("质量检测处理").Links("来料检测审核").text = "来料检测审核"
End If
Else
Dim cnt19 As Integer = DataTables("来料待检明细").SQLCompute("Count(检测状态)","[需审核人] = '"& _UserName &"' And ([检测状态] = '待检测' or [检测状态] = '驳回'or [检测状态] = '转交')")
If cnt19 > 0 Then
Forms("导航窗口").Controls("TopicBar1").Pages("质量检测处理").Links("来料检测审核").text = "来料检测审核(" & cnt19 & ")"
Else
Forms("导航窗口").Controls("TopicBar1").Pages("质量检测处理").Links("来料检测审核").text = "来料检测审核"
End If
End If
If _UserGroup Like "*效率部*" = False AndAlso _UserGroup Like "*管理员*" = False AndAlso _UserGroup Like "*技术部*" = False Then
Dim tab3 As WinForm.TabControl = Forms("导航窗口").Controls("导航")
tab3.TabPages("产品研发").Visible = False
End If
If _UserGroup Like "*经理*" = False AndAlso _UserGroup Like "*管理员*" = False AndAlso _UserGroup Like "*财务部*" = False AndAlso _UserGroup Like "*采购部*" = False Then
Dim tab2 As WinForm.TabControl = Forms("导航窗口").Controls("导航")
tab2.TabPages("采购业务").Visible = False
End If
If _UserGroup Like "*经理*" = False AndAlso _UserGroup Like "*管理员*" = False AndAlso _UserGroup Like "*财务部*" = False AndAlso _UserGroup Like "*设备部*" = False Then
Dim tab2 As WinForm.TabControl = Forms("导航窗口").Controls("导航")
tab2.TabPages("设备管理").Visible = False
End If
If _UserGroup Like "*经理*" = False AndAlso _UserGroup Like "*管理员*" = False AndAlso _UserGroup Like "*销售内贸*" = False AndAlso _UserGroup Like "*销售外贸*" = False Then
Dim tab4 As WinForm.TabControl = Forms("导航窗口").Controls("导航")
tab4.TabPages("销售业务").Visible = False
End If
If _UserGroup Like "*经理*" = False AndAlso _UserGroup Like "*管理员*" = False AndAlso _UserGroup Like "*财务部*" = False Then
Dim tab As WinForm.TabControl = Forms("导航窗口").Controls("导航")
tab.TabPages("财务业务").Visible = False
Dim tab1 As WinForm.TabControl = Forms("导航窗口").Controls("导航")
tab1.TabPages("系统管理").Visible = False
End If
If _UserGroup Like "*经理*" = False AndAlso _UserGroup Like "*管理员*" = False AndAlso _UserGroup Like "*质量部*" = False Then
Dim tab As WinForm.TabControl = Forms("导航窗口").Controls("导航")
tab.TabPages("质量管理").Visible = False
End If