Dim t As Table = Tables(e.form.name & "_Table1") Dim s As new FoxTools.Tools For i As Integer = t.Rows.count -1 To 0 Step -1 Dim r = t.Rows(i) If r Is Nothing Then Exit Function If r("状态")="已审核" Then s.Dmessage("提示", "操作 【已审核,无法删除】!",getimage("Tools_错误.png"),3,"") Else If MessageBox.show("确定删除该项吗?","提示",MessageBoxButtons.OKCancel,MessageBoxIcon.Question)=DialogResult.OK Then
Dim cmd As New SQLCommand cmd.ConnectionName = "主数据源" '删除订单明细 cmd.CommandText ="delete from {YW_采购订单明细} where 订单号='" & r("订单号") & "'" cmd.ExecuteNonQuery '删除 r.Delete End If End If Next