Foxtable(狐表)用户栏目专家坐堂 → 求助:冲突如何识别


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

主题:求助:冲突如何识别

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/1/22 14:44:00 [显示全部帖子]

Dim dc As DataCol = e.DataCol
Dim dr As DataRow = e.DataRow

Select Case dc.Name
    Case "商品编号" ,"单捆数"
        If (dr("商品编号") Like "W*" Or dr("商品编号") Like "Y*") Then
            Dim a As Integer = Nothing
            Dim b As Integer = Nothing
            If dr("订单数量") <> Nothing And dr("单捆数") = Nothing Then   '根据壁厚判断单捆数
                If mid(dr("商品编号"),9,4) >= 0900 Then
                    a = 2
                ElseIf mid(dr("商品编号"),9,4) >= 0500 Then
                    a = 3
                ElseIf mid(dr("商品编号"),9,4) >= 0300 Then
                    a = 5
                End If
            End If
           
            If dr("订单数量") <> Nothing And dr("单捆数") = Nothing Then    '根据外径判断单捆数
                If mid(dr("商品编号"),5,4) >= 0710 Then
                    b = 2
                ElseIf mid(dr("商品编号"),5,4) >= 0590 Then
                    b = 3
                ElseIf mid(dr("商品编号"),5,4) >= 0530 Then
                    b = 4
                ElseIf mid(dr("商品编号"),5,4) >= 0430 Then
                    b = 5
                ElseIf mid(dr("商品编号"),5,4) >= 0270 Then
                    b = 6
                ElseIf mid(dr("商品编号"),5,4) >= 0190 Then
                    b = 8
                ElseIf mid(dr("商品编号"),5,4) < 0190 Then
                    b = 10
                End If
            End If
            If a > 0 AndAlso b > 0 Then
                a = iif(b<a, b, a)
            ElseIf b > 0 Then
                a = b
            ElseIf a = 0 Then
                a = Nothing
            End If
            dr("单捆数") = a
        End If
End Select

 


 回到顶部