Select Case e.DataCol.name Case "司机", "车牌", "出车日期" Dim filter As String = "司机 = '" & e.DataRow("司机") & "' and 车牌 = '" & e.DataRow("车牌") & "' and 出车日期 = #" & e.DataRow("出车日期") & "#" Dim drs As List(of DataRow) = e.DataTable.Select(filter) For Each dr As DataRow In drs If DataTables("价目表").DataCols.Contains("车型_" & e.DataRow("车型")) Then Dim jdrs As List(of DataRow) = DataTables("价目表").Select("项目 like '%" & e.DataRow("项目") & "%' and 城市 like '%" & e.DataRow("城市") & "%'") For Each jdr As DataRow In jdrs If e.DataRow("地点") Like "*" & jdr("地点") & "*" Then e.DataRow("运费") = jdr("车型_" & e.DataRow("车型")) Exit For End If Next End If Next drs = e.DataTable.Select(filter, "运费 desc") For i As Integer = 0 To drs.Count - 1 Select Case drs(i)("车型") Case "9M6" drs(i)("点费") = 80 Case "6M2","6M8","7M6" drs(i)("点费") = 60 Case "4M5" drs(i)("点费") = 30 End Select If i = 0 Then drs(i)("点费") = Nothing Else drs(i)("运费") = Nothing End If Next For Each str As String In e.DataTable.GetValues("送货地址", filter) drs = e.DataTable.Select(filter & " and 送货地址 = '" & str & "'") For i As Integer = 0 To drs.Count - 1 If i > 0 Then drs(i)("点费") = Nothing End If Next Next End Select
|