以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]重置列  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=98889)

--  作者:苏州老街
--  发布时间:2017/4/8 19:03:00
--  [求助]重置列
老师好,我要重置"入库单编号"不改变原有的“认可单编号明细”的编号。


Select Case e.DataCol.Name
    Case "入库单编号"
        If e.DataRow.IsNull("入库单编号") Then
            e.DataRow("入库单编号明细") = Nothing
        Else
            Dim bh As  String = e.DataRow("入库单编号")
            Dim max  As  String
            Dim idx  As  Integer
            max = e.DataTable.Compute("Max(入库单编号明细)","入库单编号 = \'" & bh  & "\' And [_Identify] <> " & e.DataRow("_Identify")) \'取得该类别的最大入库单编号
            If max > ""  Then  \'如果存在最大入库单编号
                Dim l As Integer = bh.Length
                idx = CInt(max.Substring(l,3)) + 1  \'获得最大入库单编号的后两位顺序号,并加1
            Else
                idx = 1  \'否则顺序号等于1
            End  If
            e.DataRow("入库单编号明细") = bh & Format(idx,"000")
            
            
            
            If e.DataRow("入库单编号明细").StartsWith(idx) = False 

            End If
            
            
            
            
        End If
End Select

--  作者:有点色
--  发布时间:2017/4/9 11:12:00
--  

同样的问题,请,不要,问第二次

 

http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=98101&authorid=0&page=0&star=2

 


--  作者:苏州老街
--  发布时间:2017/4/9 15:15:00
--  
老师,好了。谢谢!