Dim dr As DataRow = e.DataRow
Dim s As String = e.filename
Dim Index As Integer = s.LastIndexOf(".")
Dim hz As String = s.SubString(Index,s.length-Index)
If dr.IsNull ("制造商") Or Dr.IsNull("订单名称") Or Dr.IsNull("姓名") Then
MessageBox.show("本次制造商,订单名称 操作人不能为空列为必填项目","提示")
e.cancel = True
Else
Dim ext As String
ext = e.FileName.SubString(e.FileName.LastIndexof(".") + 1)
Select Case e.DataCol.Name
Case "采购单"
If ext = "jpg","png","xls" Then
e.SubFolder = ext
Else
MessageBox.Show("此列只能插入JPG,PNG,xls文件!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
e.Cancel = True
End If
e.SubFolder = dr("客户") & "\" & dr("订单名称") & "\"
e.filename=e.DataRow("订单编号") & e.DataRow("文件流水") & "采购单" & hz
SystemReady = True
End Select
End If
此主题相关图片如下:微信截图_20160320094055.png