表中的缸号列,需要自动编号,项目的代码,有时候能产生编号,有时候没有反应,请求老师看看有什么不对,还有弹窗的问题,应该是代码设计不合理: 'Case "缸号"
'If e.DataRow("生产类型") = "生产" OrElse e.DataRow("生产类型") = "改染" Then
'Dim lb As String = Format(Date.Today,"yy")
'
'Dim max As String
'Dim idx As Integer
'max = e.DataTable.sqlcompute("max(缸号)","缸号 not like '%-%' and [_identify] <> " & e.DataRow("_identify") )
'If max > "" Then
'idx = cint(max.Substring(2)) + 1
'Else
'idx = 1
'End If
'e.DataRow("缸号") = lb & Format(idx,"00000")
'e.DataRow.save
'
''ElseIf e.DataRow("生产类型") = "回修" Then
''msgbox("回修允许使用重复缸号,请确认生产类型是否回修")
''ElseIf e.DataRow("生产类型") = "生产-子缸号" OrElse e.DataRow("生产类型") = "改染-子缸号" Then
''msgbox("允许手工编写缸号,请仔细确认!")
''ElseIf e.DataRow.Isnull("生产类型") = True Then
''msgbox("请选择生产类型,才能输入缸号")
''e.DataRow("缸号") = Nothing
'End If