Foxtable(狐表)用户栏目专家坐堂 → 应为标识符


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

主题:应为标识符

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/5/28 10:34:00 [只看该作者]


Select Case e.DataCol.name
    Case "时间","委托部门代码"
        If dr.Isnull("时间") And dr.Isnull("委托部门代码")
            dr("项目代码") = Nothing
        Else
            Dim d As Date = dr("时间")
            Dim y As Integer =d.year
            Dim wtbmdm As String =dr("委托部门代码")
            Dim bh As String = Format(d,"yyyy") & "-" & dr("委托部门代码")
            If dr("项目代码").startswith(bh)= False
                Dim max As String
                Dim idx As Integer
                max= e.DataTable.compute("max(项目代码)","时间 = # " & y & "#  and 委托部门代码 = '"& wtbmdm &"'  And [_Identify] <>" & dr("_Identify"))
                If max > "" Then
                    idx = CInt(max.Substring(bh.length,3)) + 1
                Else idx= 1
                End If
                dr("项目代码")= bh & "-" & Format(idx,"000")
            End If
        End If
End Select

 

 


 回到顶部