老师,下面代码在没有保存的时候清空图片列和删除行都可以的,通过按钮保存后再用下面代码为报错。
![dvubb 图片点击可在新窗口打开查看](skins/default/filetype/png.gif)
此主题相关图片如下:image 1.png
![dvubb 图片点击可在新窗口打开查看](UploadFile/2019-11/201911921241111728.png)
If Tables("出库.出库明细") .Rows.count = 0 Then
MessageBox.Show("没有可删除!")
Return
End If
If Tables("出库.出库明细") .Rows.count > 0 AndAlso Tables("出库.出库明细") .Current.Isnull("审核人") = False Then
MessageBox.Show("已审核,请反审!")
Return
End If
If Tables("出库.出库明细") .Current.Isnull("审核人") = True Then
If MessageBox.Show("是否删除?","确认",MessageBoxButtons.OKCancel,MessageBoxIcon.Question) =DialogResult.OK Then
If GetConfigValue("文件夹路径1" & ComputerId,"") = "" Then
MessageBox.Show("请先指定存储路径!","提醒")
Return
End If
If Tables("出库.出库明细").Current.isnull("送货单") = True Then '若未存储文件名
MessageBox.Show("未上传文件!","提醒")
Return
End If
If e.Form.Controls("文件名").text = "文件已被删除!" Then
Tables("出库.出库明细").Current("送货单") = Nothing
e.Form.Controls("文件名").text = "未上传文件!"
Return
End If
If MessageBox.Show("是否删除文件?","提醒",MessageBoxButtons.YesNo,MessageBoxIcon.Question) = DialogResult.Yes Then
filesys.DeleteFile(e.Form.Controls("路径").text & "\" & e.Form.Controls("文件名").text,2,2)
e.Form.Controls("文件名").text = "未上传文件!"
Tables("出库.出库明细").Current("送货单") = Nothing
Tables("出库.出库明细") .Current.Delete
End If
End If
End If