If vars("state") = 0 Then '已经保存过
For Each dt As DataTable In DataTables
If dt.HasChanges Then
MyTimers("计划1").Interval = 180000 '设置为3分钟后提示
vars("state") = 1
Return
End If
Next
ElseIf vars("state") = 1 Then '3分钟提示
MyTimers("计划1").Enabled= False
If MessageBox.Show("数据已经修改,是否现在保存,选否15分钟后再提示, The data has been modified, whether it is now saved, selected 15 minutes after the prompt","温馨提示",MessageBoxButtons.YesNo) = DialogResult.Yes
For Each dt As DataTable In DataTables
dt.Save
Next
MyTimers("计划1").Interval = 60000 '设置为每60秒后检测是否改动,根据需要自己改
vars("state") = 0
Else
MyTimers("计划1").Interval = 900000 '设置为15分钟后提示
vars("state") = 2
End If
ElseIf vars("state") = 2 Then '20分钟提示
MyTimers("计划1").Enabled= False
If MessageBox.Show("数据已经修改,是否现在保存,选否15分钟后再提示, The data has been modified, whether it is now saved, selected 15 minutes after the prompt","温馨提示",MessageBoxButtons.YesNo) = DialogResult.Yes
For Each dt As DataTable In DataTables
dt.Save
Next
MyTimers("计划1").Interval = 900000 '设置为每10秒后检测是否改动,根据需要自己改
vars("state") = 0
End If
End If
MyTimers("计划1").Enabled= True