Foxtable(狐表)用户栏目专家坐堂 → 求和计算使用求助


  共有1222人关注过本帖树形打印复制链接

主题:求和计算使用求助

帅哥,在线噢!
y2287958
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐神 帖子:4649 积分:33907 威望:0 精华:0 注册:2008/8/31 22:44:00
  发帖心情 Post By:2023/12/5 9:24:00 [显示全部帖子]

If e.DataCol.Name = "工时" Then
    If e.DataRow("姓名") <> "部门" Then
        Dim dr As DataRow = e.DataTable.Find("姓名='部门'")
        If dr IsNot Nothing Then
            dr("工时") = e.DataTable.Compute ("Sum(工时)", "姓名<>'部门' and 姓名 is not null")
        End If 
    End If
End If

If e.DataCol.Name = "奖金" AndAlso e.DataRow("姓名") = "部门" Then
    Dim dr As DataRow = e.DataTable.Find("姓名='部门'")
    If dr.IsNull ("奖金") = False AndAlso dr.IsNull ("工时") = False Then
        Dim 工时奖金 As Decimal = dr("奖金") / dr("工时")
        For Each sdr As DataRow In e.DataTable.Select ("姓名<>'部门' and 姓名 is not null")
            sdr("奖金") = sdr("工时") * 工时奖金
        Next 
    End If
End If


 回到顶部