Private Sub KeepPerson(ByVal DocInNo As String)
Dim TmpUID,TmpType As String
Dim DT As DataTable
Dim i As Integer
SQLStatement = " SELECT DISTINCT UID "
SQLStatement &= " FROM XMFLOW_BOX WHERE XMDOC_INNO = '"& DocInNo &"' "
SQLStatement &= " AND [Object_ID] <> ( SELECT MAX([Object_ID]) "
SQLStatement &= " FROM XMFLOW_BOX WHERE XMDOC_INNO = '"& DocInNo &"' "
SQLStatement &= " GROUP BY XMDOC_INNO ) "
DT = XiqmaLib.GetDataBase(XiqmaLib.GetConnectionBase(),SQLStatement)
IF IsNothing(DT) = False ANDAlso DT.Rows.Count <> 0 Then
FOR i = 0 TO DT.Rows.Count - 1
IF i >= 1 Then TmpUID &= ","
TmpUID &= DT.Rows(i).Item("UID") & ""
IF i >= 1 Then TmpType &= ","
TmpType &= "1"
NEXT
End IF
fUID.Text = TmpUID
fType.Text = TmpType
End Sub