Dim dr As DataRow = e.DataRow If dr.IsNull("产品名称") Then MessageBox.Show("请先输入身份证号码!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information) e.Cancel = True Else Dim ss As String = e.filename Dim Index As Integer = ss.LastIndexOf(".") Dim hz As String = ss.SubString(Index,ss.length-Index) ss = dr("产品名称") e.filename = ss & hz If e.DataRow(e.DataCol.name).Contains(ss) Then Dim max As Integer = 0 For Each s As String In e.DataRow.Lines(e.DataCol.name) If s Like "*" & ss & "*" Then Dim fni1 As Integer=s.LastIndexOf("-") If fni1 > -1 Then Dim fni2 As Integer = s.LastIndexOf(".") fni1 = s.SubString(fni1+1, fni2 - fni1 - 1) If fni1 > max Then max = fni1 End If End If End If Next e.filename = ss & "-" & (max+1) & hz End If End If
|