Dim dt As DataTable = DataTables("排班窗口")
Dim num1 As Integer=0
For Each dr As DataRow In dt.DataRows
If dr.RowState <> DataRowState.unchanged Then
num1 = num1 + 1
End If
Next
If num1>0 Then
Dim Result As DialogResult
Result = MessageBox.Show("排班表已经修改,是否需要保存?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If Result = DialogResult.Yes Then
For Each dr1 As DataRow In dt.DataRows
If dr1.RowState <> DataRowState.unchanged Then
dr1.Save()
End If
Next
Else
dt.RejectChanges()
End If
CurrentTable.Refresh()
Forms("排班窗口").Close
Else
Forms("排班窗口").Close
End If
[此贴子已经被作者于2015/8/14 15:27:03编辑过]