1、Dim dr As DataRow = e.DataRowIf dr.IsNull("商品ID") Or Dr.IsNull("批号") Then
MessageBox.Show("请先输入商品ID或批号!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
e.Cancel = True
Else
Dim arr() As String = e.FileName.split(".")
e.FileName = dr("商品ID") & "_" & dr("批号") & "_" & dr("有效日期") & "." & arr(arr.Length - 1)
End If
2、窗体AfterLoad事件
DataTables("进仓单明细").DataCols("COA").ExtendType = ExtendTypeEnum.FILES
DataTables("进仓单明细").DataCols("COA").DefaultFolder = "\\192.168.1.18\PG\YLJianNianDan\COA"
DataTables("进仓单明细").DataCols("COA").AutoDeleteAttachFile = True