以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  合并导入,没有实现自动+1  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=133186)

--  作者:fubblyc
--  发布时间:2019/4/9 11:07:00
--  合并导入,没有实现自动+1

老师,不知道为什么合并导入,不能实现 自动 +1



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



DataColChanged


If e.DataCol.name = "店铺名称"  Then

    If e.DataRow.Isnull("店铺名称") = False Then

        Dim n As Integer = 1

        Dim dr As DataRow = DataTables("租金支付基础信息").sqlfind("店铺名称 = \'" & e.DataRow("店铺名称") & "\' "  , " _identify Desc "  )

        If dr IsNot Nothing Then

            n = dr("唯一编号").Substring(dr("唯一编号").LastIndexOf("-")+1) + 1

            e.DataRow("cms编码") = dr("cms编码")

            e.DataRow("品牌") = dr("品牌")

            e.DataRow("经营类别") = dr("经营类别")

            e.DataRow("具体地址") = dr("具体地址")

        End If


        e.DataRow("唯一编号") = e.DataRow("店铺名称") + "-"  &  n

    Else

        e.DataRow("唯一编号") = Nothing

    End If

    DataTables("租金支付基础信息").save()

End If



--  作者:有点甜
--  发布时间:2019/4/9 12:51:00
--  

Dim dr As DataRow = DataTables("租金支付基础信息").sqlfind("店铺名称 = \'" & e.DataRow("店铺名称") & "\' "  , " _identify Desc "  )

 

改成

 

Dim dr As DataRow = DataTables("租金支付基础信息").find("店铺名称 = \'" & e.DataRow("店铺名称") & "\' "  , " _identify Desc "  )

If dr Is Nothing Then dr = DataTables("租金支付基础信息").sqlfind("店铺名称 = \'" & e.DataRow("店铺名称") & "\' "  , " _identify Desc "  )