以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  请高手指教  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=32705)

--  作者:良才
--  发布时间:2013/5/6 20:20:00
--  请高手指教

If e.DataCol.Name="学期" OrElse e.DataCol.Name="教工编号" Then
    If e.DataRow.IsNull("学期")=False AndAlso e.DataRow.IsNull("教工编号")=False Then
        Dim jgxx As DataRow = DataTables("教工基本信息").Find("教工编号=\'" & e.DataRow("教工编号") & "\'")
        Dim bzgz As DataRow = DataTables("标准工资").Find("学期=\'" & e.DataRow("学期") & "\'")
        If jgxx IsNot Nothing AndAlso bzgz IsNot Nothing Then
            e.DataRow("教工姓名")=jgxx("教工姓名")
            e.DataRow("岗位工资")=bzgz("岗位工资")
            e.DataRow("生活津贴")=bzgz("生活津贴")
            e.DataRow("通讯津贴")=bzgz("通讯津贴")
            e.DataRow("交通津贴")=bzgz("交通津贴")
            e.DataRow("公积金津贴")=bzgz("公积金津贴")
            e.DataRow("全勤奖")=bzgz("全勤奖")
            e.DataRow("值日津贴")=bzgz("值日津贴")
            e.DataRow("工龄工资")=jgxx("教龄")*bzgz("工龄基数")
        End If
    End If
End If

Select Case e.DataCol.Name
    Case "学期","教工编号"
        Dim dr As DataRow = e.DataRow
        Dim pr As DataRow
        If dr.IsNull("学期") OrElse dr.IsNull("教工编号") Then
            dr("职务津贴") = Nothing
        Else
            Dim filter As String
            filter = "学期 = \'" & dr("学期") & "\' And 教工编号 = \'" & dr("教工编号") & "\'"
            pr = DataTables("班主任津贴").Find(filter)
            If pr IsNot Nothing Then
                dr("职务津贴") = pr("班主任津贴")
            End If
        End If
End Select

Select Case e.DataCol.Name
    Case "学期","教工编号"
        Dim dr As DataRow = e.DataRow
        Dim pr As DataRow
        If dr.IsNull("学期") OrElse dr.IsNull("教工编号") Then
            dr("职务津贴") = Nothing
        Else
            Dim filter As String
            filter = "学期 = \'" & dr("学期") & "\' And 教工编号 = \'" & dr("教工编号") & "\'"
            pr = DataTables("干部职务津贴").Find(filter)
            If pr IsNot Nothing Then
                dr("职务津贴") = pr("岗位津贴")
            End If
        End If
End Select

Select Case e.DataCol.Name
    Case "学期","教工编号"
        Dim dr As DataRow = e.DataRow
        Dim pr As DataRow
        If dr.IsNull("学期") OrElse dr.IsNull("教工编号") Then
            dr("绩效工资") = Nothing
        Else
            Dim filter As String
            filter = "学期 = \'" & dr("学期") & "\' And 教工编号 = \'" & dr("教工编号") & "\'"
            pr = DataTables("教师绩效工资").Find(filter)
            If pr IsNot Nothing Then
                dr("绩效工资") = pr("绩效工资")
            End If
        End If
End Select

 

请高手指教,帮我优化。