Case "旁站类别"
If dr.IsNull("旁站类别") Then
dr("旁站编号") = Nothing
Else
Dim flag As Boolean = False
Dim fdr1 As DataRow = DataTables("系统设置").Find("内容 = '" & dr("旁站类别") & "'")
If fdr1 IsNot Nothing Then
Dim lb As String = fdr1("值") & "-"
Dim bhs As List(of String) = e.DataTable.GetValues("旁站编号", "旁站编号 Like '" & lb & "%' And [_Identify] <> " & e.DataRow("_Identify"))
For i As Integer = 1 To bhs.count
If bhs(i-1) <> lb & Format(i, "0000") Then
lb = lb & Format(i, "0000")
flag = True
Exit For
End If
Next
If bhs.count = 0 Then
lb = lb & "0001"
ElseIf flag = False Then
lb = lb & Format(bhs.count+1, "0000")
End If
dr("旁站编号") = lb
End If
End if