--
Select Case e.DataCol.name
Case "规格", "工序","备注"
Dim fdr As DataRow = DataTables("价目表").find("产品规格及名称 = \'" & e.DataRow("规格") & "\' and 工序 = \'" & e.DataRow("工序") & "\' and 细目 = \'" & e.DataRow("备注") & "\'")
If fdr IsNot Nothing
If e.DataRow("备注1") Like "*单面*" Then
e.DataRow("单价") = fdr("单价") / 2
Else
e.DataRow("单价") = fdr("单价")
End If
End If
End Select
Select Case e.DataCol.name
Case "姓名","岗位"
Dim d As Date = e.DataRow("日期")
d = new Date(d.year, d.month, 1)
Dim fdr As DataRow = DataTables("系数表").find("姓名 = \'" & e.DataRow("姓名") & "\' and 日期 >= #" & Format(d,"yyyy-MM-dd") & "# and 日期 < #" & Format(d.AddMonths(1),"yyyy -MM-dd") & "#", "日期 desc")
\'Dim fdr As DataRow = DataTables("系数表").find("姓名 = \'" & e.DataRow("姓名") & "\' and 日期 >= #" & d & "# and 日期 < #" & d.AddMonths(1) & "#", "日期 desc")
If fdr IsNot Nothing
e.DataRow("系数") = fdr("系数")
e.DataRow("岗位") = fdr("级别")
Else
e.DataRow("岗位") = Nothing
e.DataRow("系数") = Nothing
End If
End Select