Foxtable(狐表)用户栏目专家坐堂 → 不知道哪里错了


  共有3848人关注过本帖平板打印复制链接

主题:不知道哪里错了

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/12/9 18:08:00 [只看该作者]

Dim dt As DataTable = DataTables("应付款项")
Dim p As WinForm.ProgressBar
p = e.Form.Controls("ProgressBar1")
Dim filter As String = Tables("应付款项").Filter
filter = iif(filter>"", filter, "1=1")
Dim arys As List(of String()) = dt.GetValues( "司机|车牌|出车日期", "出车日期 is not null and 运费 is null and 点费 is null and " & filter)
If arys.count > 0 Then
    p.Visible = True
    p.Maximum =  arys.Count - 1 '设置最大值
    p.Minimum = 0 '设置最小值
    p.Value = 0 '设置当前值
End If

Dim idx As Integer = 0
DataTables("应付款项").StopRedraw

For Each ary() As String In  arys
    idx += 1
    p.Value = idx '加在这里
    Dim fil As String = "司机 = '" & ary(0) & "' and 车牌 = '" & ary(1) & "' and 出车日期 = #" & ary(2) & "#"
    Dim drs As List(of DataRow) = dt.Select(fil)
    For Each dr As DataRow In drs
        If DataTables("价目表").DataCols.Contains("车型_" & dr("车型")) Then
            Dim jdrs As List(of DataRow) = DataTables("价目表").Select("项目 like '%" & dr("项目") & "%' and 城市 like '%" & dr("城市") & "%'")
            For Each jdr As DataRow In jdrs
                If dr("地点") Like "*" & jdr("地点") & "*" Then
                    dr("运费") = jdr("车型_" & dr("车型"))
                    Exit For
                End If
            Next
        End If
    Next
   
    drs = dt.Select(fil, "运费 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","4M2"
                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 dt.GetValues("送货地址", fil )
        drs = dt.Select(fil & " and 送货地址 = '" & str & "'")
        For i As Integer = 0 To drs.Count - 1
            If i > 0 Then
                drs(i)("点费") = Nothing
            End If
        Next
    Next
Next
DataTables("应付款项").ResumeRedraw
p.Visible = False


 回到顶部
总数 41 1 2 3 4 5 下一页