Select e.DataCol.Name
Case "面试室"
If e.DataRow.IsNull("面试室") Then
e.DataRow("抽签序号") = Nothing
Else
Dim mss() As String = {"面试室1","面试室2","面试室3"}
Dim dms() As String = {"a","b","c"}
Dim lb As String
For i As Integer = 0 To mss.Length - 1
If mss(i) = e.NewValue Then
lb = dms(i)
Exit For
End If
Next
If lb > "" AndAlso e.DataRow("抽签序号").StartsWith(lb) = False '如果单据编号前缀不符
Dim max As String
Dim idx As Integer
max = e.DataTable.Compute("Max(抽签序号)","面试室 = '" & e.NewValue & "'") '取得该类别的最大编号
If max > "" Then '如果存在最大编号
idx = CInt(max.Substring(1,2)) + 1 '获得最大编号的后2位顺序号,并加1
Else
idx = 1 '否则顺序号等于1
End If
e.DataRow("抽签序号") = lb & Format(idx,"00")
End If
End If
End Select