Dim dt As DataTable=Tables("kpinfo").DataTable
Dim dt1 As DataTable=Tables("ldinfo").DataTable
If dt.haschanges And dt1.haschanges Then
If MessageBox.Show("是否保存当前单据?","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Information)=7 Then '如果按否则删掉本行数据
For i As Integer = dt.datarows.count - 1 To 0 Step -1
If dt.datarows(i).RowState=DataRowstate.added Then
dt.datarows(i).delete
End If
Next
For i As Integer = dt1.datarows.count - 1 To 0 Step -1
If dt1.datarows(i).RowState=DataRowstate.added Then
dt1.datarows(i).delete
End If
Next
Else '否则退回编辑界面
MessageBox.Show("请点击保存按钮保存","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
End If
e.Form.close
Forms("windows").open