Foxtable(狐表)用户栏目专家坐堂 → 对比两个表,并标记出不同


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

主题:对比两个表,并标记出不同

帅哥哟,离线,有人找我吗?
Hyphen
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐神 帖子:5015 积分:25363 威望:0 精华:0 注册:2015/8/18 9:21:00
  发帖心情 Post By:2016/8/10 9:02:00 [显示全部帖子]

出勤相关drawcell

If e.Row.IsNull("日期") = False Then
    
    Dim d As Date = e.Row("日期")
    
    If d.DayOfWeek = 0 OrElse d.DayOfWeek = 6 Then
        e.style = "周六日"
    End If
    If e.Row.IsNull("当事人") = False Then
        Dim dr As DataRow = DataTables("考勤机").Find(CExp("姓名='{0}' and 日期 = #{1}#",e.Row("当事人"),e.Row("日期") ))
        If dr IsNot Nothing AndAlso dr("一倍半加班H") <> e.Row("一倍半加班H") Then
            e.Style = "差异"
        End If
    End If
End If

考勤机drawcell

If e.Row.IsNull("日期") = False Then
    
    Dim d As Date = e.Row("日期")
    
    If d.DayOfWeek = 0 OrElse d.DayOfWeek = 6 Then
        e.style = "周六日"
    End If
    If e.Row.IsNull("姓名") = False Then
        Dim dr As DataRow = DataTables("出勤相关").Find(CExp("当事人='{0}' and 日期 = #{1}#",e.Row("姓名"),e.Row("日期") ))
        If dr IsNot Nothing AndAlso dr("一倍半加班H") <> e.Row("一倍半加班H") Then
            e.Style = "差异"
        End If
    End If
End If

 回到顶部
帅哥哟,离线,有人找我吗?
Hyphen
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐神 帖子:5015 积分:25363 威望:0 精华:0 注册:2015/8/18 9:21:00
  发帖心情 Post By:2016/8/13 14:41:00 [显示全部帖子]

Dim ary() As String = {"一倍半加班H", "二倍加班H", "三倍加班H"}
If array.Indexof(ary, e.Col.name) >= 0 Then
    If e.Row.IsNull("日期") = False AndAlso e.Row.IsNull("当事人") = False Then
        Dim dr As DataRow = DataTables("考勤机").Find(CExp("姓名='{0}' and 日期 = #{1}#",e.Row("当事人"),e.Row("日期") ))
        If dr IsNot Nothing Then
            If dr(e.Col.name) <> e.Row(e.Col.name) Then
                e.Style = "差异"
            End If
        Else
            e.Style = "差异"
        End If
    End If
End If

 回到顶部