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


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

主题:编号问题

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


加好友 发短信
等级:五尾狐 帖子:1172 积分:8772 威望:0 精华:0 注册:2012/4/18 16:28:00
  发帖心情 Post By:2016/6/28 13:52:00 [显示全部帖子]

设置代码列,列的内容就是“内贸”

采用这种格式会好些
Select e.DataCol.Name
    Case "代码".....

给你个参考 这段代码编出来的是例如:P16001-110001Z-DQ201-01
Select e.DataCol.Name
    Case "系统编号_工程专业","系统编号_年份日期","设计编号_电压等级","设计编号_设计阶段","图纸编号_专业类别","图纸编号_顺序编号"
        If e.DataRow.IsNull("系统编号_工程专业") OrElse e.DataRow.IsNull("系统编号_年份日期") OrElse e.DataRow.IsNull("设计编号_电压等级") OrElse e.DataRow.IsNull("设计编号_设计阶段") OrElse e.DataRow.IsNull("图纸编号_专业类别") OrElse e.DataRow.IsNull("图纸编号_顺序编号") Then
            e.DataRow("图签图号") = Nothing
        Else
            Dim d As Date = e.DataRow("系统编号_年份日期")
            d = new Date(d.Year, 1,1)
            Dim max As Integer
            Dim flt As String
            flt = "系统编号_工程专业 = '"& e.DataRow("系统编号_工程专业") & "' And 系统编号_年份日期 >= #" & d & "# and 系统编号_年份日期 < #" & d.AddYears(1) & "# And [_Identify] <> " & e.DataRow("_Identify")
            max = e.DataTable.Compute("Max(系统编号_顺序编号)",flt) '取得该月的相同工程代码的最大单据编号
            e.DataRow("系统编号_顺序编号") = max + 1
            flt = "系统编号_工程专业 = '"& e.DataRow("系统编号_工程专业") & "' And 设计编号_电压等级 = '" & e.DataRow("设计编号_电压等级") & "' And 系统编号_年份日期 >= #" & d & "# and 系统编号_年份日期 < #" & d.AddYears(1) & "# And [_Identify] <> " & e.DataRow("_Identify")
            max = e.DataTable.Compute("Max(设计编号_工程编号)",flt) '取得该月的相同工程代码的最大单据编号
            e.DataRow("设计编号_工程编号") = max + 1
            flt = "系统编号_工程专业 = '"& e.DataRow("系统编号_工程专业") & "' and 图纸编号_专业类别 = '" & e.DataRow("图纸编号_专业类别") & "' and 设计编号_电压等级 = '" & e.DataRow("设计编号_电压等级") & "' And 系统编号_年份日期 >= #" & d & "# and 系统编号_年份日期 < #" & d.AddYears(1) & "# And [_Identify] <> " & e.DataRow("_Identify")
            max = e.DataTable.Compute("Max(设计编号_工程编号)",flt) '取得该月的相同工程代码的最大单据编号
            'e.DataRow("分册顺序号") = max + 1
            e.DataRow("图签图号") = e.DataRow("系统编号_工程专业") & format(d, "yy") & format(e.DataRow("系统编号_顺序编号"), "000-") & e.DataRow("设计编号_电压等级") & format(e.DataRow("设计编号_工程编号"), "000") & e.DataRow("设计编号_设计阶段") & "-" & e.DataRow("图纸编号_专业类别") & Format(e.DataRow("图纸编号_分册编号"), "00-") & Format(e.DataRow("图纸编号_顺序编号"),"00")
        End If
End Select


 回到顶部