Foxtable(狐表)用户栏目专家坐堂 → 请教编号问题


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

主题:请教编号问题

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


加好友 发短信
等级:狐神 帖子:6708 积分:34304 威望:0 精华:11 注册:2012/8/18 23:10:00
  发帖心情 Post By:2012/11/30 17:45:00 [显示全部帖子]

 好晕,你这样试一下。

Select e.DataCol.Name
    Case "接单时间","部门"
        If e.DataRow.IsNull("接单时间") Then
            e.DataRow("管制号") = Nothing
        Else
            Dim d As Date = e.DataRow("接单时间")
            Dim y As Integer = d.Year
            Dim m As Integer = d.Month
            Dim Days As Integer = Date.DaysInMonth(y,m)
            Dim fd As Date = New Date(y,m,1)
            Dim ld As Date = New Date(y,m,Days)
            Dim bh As String = e.DataRow("部门") & "-" & Format(d,"yyyyMM") & "-"
            If e.DataRow("管制号").StartsWith(bh) = False
                Dim max As String
                Dim idx As Integer
                Dim flt As String
                flt = "部门 = '"& e.DataRow("部门") & "' And 接单时间 >= #" & fd & "# And 接单时间 <= #" & ld & "#"
                max = e.DataTable.Compute("Max(管制号)",flt)
                If max > "" Then
                    idx = CInt(max.Substring(9,4)) + 1
                Else
                    idx = 1
                End If
                e.DataRow("管制号") = bh & Format(idx,"0000")
            End If
        End If
End Select

If e.DataCol.Name = "交货日期" Then
    If e.DataRow.IsNull("交货日期") Then
        e.DataRow("延期") = Nothing
    Else
        e.DataRow("延期") = (Date.Today.Subtract(e.DataRow("交货日期")).Days)
    End If
End If

Select Case e.DataCol.Name
    Case "管制号"
        If e.DataRow.IsNull("管制号") = False Then
            If e.DataRow.GetChildRows("订单明细").Count = 0 Then
                Dim dr As DataRow = DataTables("订单明细").AddNew(1)
                dr("管制号") = e.DataRow("管制号")
                dr("交货日期") = e.DataRow("交货日期")
                dr("客户") = e.DataRow("客户")
            End If
        End If
End Select

Select Case e.DataCol.Name
    Case "客户"
        If e.DataRow.IsNull("客户") = False Then
            If e.DataRow.GetChildRows("客户").Count = 0 Then
                Dim dr As DataRow = DataTables("客户").AddNew()
                dr("客户") = e.DataRow("客户")
            End If
        End If
End Select



 回到顶部
帅哥哟,离线,有人找我吗?
lin_hailun
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐神 帖子:6708 积分:34304 威望:0 精华:11 注册:2012/8/18 23:10:00
  发帖心情 Post By:2012/12/1 8:58:00 [显示全部帖子]

 不清楚具体问题,没有项目,只有代码,不便测试。或者联系客服QQ协助解决吧。

 回到顶部
帅哥哟,离线,有人找我吗?
lin_hailun
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐神 帖子:6708 积分:34304 威望:0 精华:11 注册:2012/8/18 23:10:00
  发帖心情 Post By:2012/12/1 14:45:00 [显示全部帖子]

以下是引用秦胜雄在2012-12-1 14:41:00的发言:

现在又可以正常使用了,开机时有个激活框提示,不知还能试用多长时间,以便公司决定是否购买。


估计,快了……可能还能使用几天到十来天。

 回到顶部