以文本方式查看主题 - Foxtable(狐表) (http://www.foxtable.com/bbs/index.asp) -- 专家坐堂 (http://www.foxtable.com/bbs/list.asp?boardid=2) ---- 【代码修正】代码注释部分如果取消注释,会生成编号,但是不会根据卷宗册数对应【入库明细】表里面生成对应卷宗册数的分册编号数据记录 (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=108483) |
-- 作者:李孝春 -- 发布时间:2017/10/23 20:18:00 -- 【代码修正】代码注释部分如果取消注释,会生成编号,但是不会根据卷宗册数对应【入库明细】表里面生成对应卷宗册数的分册编号数据记录 【代码修正】代码注释部分如果取消注释,会生成编号,但是不会根据卷宗册数对应【入库明细】表里面生成对应卷宗册数的分册编号数据记录 麻烦修正代码,让注释部分即可以生成编号,其他代码又可以对应完成各自运行 谢谢 比如5册卷宗 对应新增五条分册编号的入库明细 5-1 5-2 5-3 5-4 5-5 代码如下: Dim Val1 As String = e.DataRow("所属地州") Dim Val11 As String = e.DataRow("所属单位") Dim Val111 As String = e.DataRow("卷宗名称") Dim Val1111 As String = e.DataRow("卷宗册数") Dim Val11111 As String= e.DataRow("录入时间") \'If e.DataCol.Name = "录入时间" Then \'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 = Format(d,"yyyyMM") \'生成卷宗编号的前6位,4位年,2位月. \'If e.DataRow("卷宗编号").StartsWith(bh) = False \'如果卷宗编号的前6位不符 \'Dim max As String \'Dim idx As Integer \'max = e.DataTable.Compute("Max(卷宗编号)","录入时间 >= #" & fd & "# And 录入时间 <= #" & ld & "# And [_Identify] <> " & e.DataRow("_Identify")) \'取得该月的最大卷宗编号 \'If max > "" Then \'如果存在最大卷宗编号 \'idx = CInt(max.Substring(7,3)) + 1 \'获得最大卷宗编号的后三位顺序号,并加1 \'Else \'idx = 1 \'否则顺序号等于1 \'End If \'e.DataRow("卷宗编号") = bh & "-" & Format(idx,"000") \'End If \'End If \'End If \' Dim val0 As String = "所属地州:[" & val1 & "]" & "所属单位:[" & val11 & "]" & "案卷名:[" & val111 & "]" & "册数:[" & val1111 & "]" & "入库时间:[" & Val11111 & "]" Select Case e.DataCol.Name Case "所属地州","所属单位","卷宗名称","承办人","承办部门","联系电话" e.DataRow("加密字符")=EncryptText(Val0,"a23","op#") Case "卷宗册数" e.DataRow("加密字符")=EncryptText(Val0,"a23","op#") For i As Integer = 1 To e.DataRow("卷宗册数") Dim ndr As DataRow = DataTables("入库明细").find("卷宗编号 = \'" & e.DataRow("卷宗编号") & "\'") If ndr Is Nothing Then ndr = DataTables("入库明细").AddNew End If ndr("卷宗名称") = e.DataRow("卷宗名称") ndr("分册编号")=e.DataRow("卷宗册数") & "--" &0+i ndr("所属地州") = e.DataRow("所属地州") ndr("所属单位") = e.DataRow("所属单位") ndr("卷宗册数") = e.DataRow("卷宗册数") ndr("录入时间") = e.DataRow("录入时间") ndr("卷宗编号") = e.DataRow("卷宗编号") ndr("承办人") = e.DataRow("承办人") ndr("承办部门") = e.DataRow("承办部门") ndr("联系电话") = e.DataRow("联系电话") Next End Select
|
-- 作者:有点蓝 -- 发布时间:2017/10/23 21:00:00 -- Dim ndr As DataRow = DataTables("入库明细").find("卷宗编号 = \'" & e.DataRow("卷宗编号") & "\' and 分册编号 = \'" & e.DataRow("卷宗册数") & "--" & i & "\'") |
-- 作者:李孝春 -- 发布时间:2017/10/23 21:24:00 -- 回复:(有点蓝)Dim ndr As DataRow = DataTables("入... 谢谢 |