以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  这个是什么意思?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=20910)

--  作者:jinzhengbe
--  发布时间:2012/6/23 6:10:00
--  这个是什么意思?

代码如下 : 是代码的问题么?

 

 

Select  e.DataCol.Name
    Case = "商城","客户名称","店铺名称","_Identify"
        If e.DataRow.IsNull("商城") OrElse e.DataRow.IsNull("客户名称") OrElse e.DataRow.IsNull("店铺名称")  Then
            e.DataRow("取货商品名") = Nothing
        Else
            Dim bh As String = "QF-"  &e.DataRow("商城") & "-"  &e.DataRow("店铺名称") & "-" & e.DataRow("客户名称")  & "-" & e.DataRow("_Identify")       \'生成该月编号的前缀
            Dim idx As Integer
            idx = e.DataTable.Compute("Count(取货商品名)","取货商品名 like \'" & bh _
            & "*\' and [_identify] < " & e.DataRow("_identify") & " ") +1
            e.DataRow("取货商品名") = bh  
        End If
End Select
If e.DataCol.Name = "客户名称" Then \'发生变化的是客户名吗?
       Dim dr As DataRow
    dr = DataTables("客户资料").Find("name2 = " & "\'" & e.DataRow("客户名称") & "\'" )
    If dr IsNot Nothing \'如果找到, 则设置各列内容
        e.DataRow("邮箱")= dr("qq") & "@QQ.com"
      
    End If
End If

 

Dim aa As Integer= e.DataRow("应取数量")-e.DataRow("已取数量")
If e.DataRow("应取数量") <> 0 And aa >0 Then
e.DataRow ("状态")= 2
Else If e.DataRow("应取数量") <> 0 And aa <=0 Then
e.DataRow ("状态")= 6
Else
Dim tbl As Table = Tables("取货录入表")
    If tbl.Current IsNot Nothing Then
             Tables("取货录入表").Current("状态") = e.DataRow("状态")
     
End If


图片点击可在新窗口打开查看此主题相关图片如下:??.png
图片点击可在新窗口打开查看

--  作者:don
--  发布时间:2012/6/23 7:06:00
--  

朦一下:


Dim dr,dr1 As DataRow

Dim idx As Integer

dr = e.DataRow

Select  e.DataCol.Name

    Case "商城","客户名称","店铺名称"

        If dr.IsNull("商城") OrElse dr.IsNull("客户名称") OrElse dr.IsNull("店铺名称")  Then

            dr("取货商品名") = Nothing

        Else

            Dim bh As String = "QF-"  & dr("商城") & "-"  & dr("店铺名称") & "-" & dr("客户名称")  & "-" & dr("_Identify")       \'生成该月编号的前缀

            \'idx = e.DataTable.Compute("Count(取货商品名)","取货商品名 like \'" & bh & "*\' and [_identify] < " & dr("_identify")) +1  \'這idx沒有引用它,應該不要 

            dr("取货商品名") = bh

        End If

    Case  "客户名称"   

        dr1 = DataTables("客户资料").Find("name2 = " & "\'" & dr("客户名称") & "\'" )

        If dr1 IsNot Nothing \'如果找到, 则设置各列内容

            dr1("邮箱")= dr("qq") & "@QQ.com"

        End If

    Case  "应取数量","已取数量"

        idx = dr("应取数量")-dr("已取数量")

        If dr("应取数量") <> 0 AndAlso  idx >0 Then

            dr ("状态")= 2

        ElseIf dr("应取数量") <> 0 AndAlso  idx < = 0 Then

            dr ("状态")= 6

        Else

            Dim tbl As Table = Tables("取货录入表")

            If tbl.Current IsNot Nothing Then

                Tables("取货录入表").Current("状态") = dr("状态")

            End If

        End If

End Select