I added a Evaluations.CurrentDataTable.AcceptChanges() statement immediately after each Evaluations.Add() to accept the changes to the table but not the database. This gaves me Original datavalues that I can compare to the Current datavalues to see if anything has changed.Here's some code I placed in the FormClosing event:
Dim ix As Integer = Evaluations.CurrentDataTable.Columns.CountDim isDirty As BooleanFor ix = 0 To Evaluations.CurrentDataTable.Columns.Count - 1 If Evaluations.CurrentRow.Item(ix, Data.DataRowVersion.Original) <> Evaluations.CurrentRow.Item(ix, Data.DataRowVersion.Current) Then
isDirty =
True Exit For End IfNextIf isDirty Then Dim dlgResult As DialogResult dlgResult = MessageBox.Show(
"Do you want to save changes?", My.Application.Info.Title, _ MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button3)
Select Case dlgResult
Case Windows.Forms.DialogResult.Cancel
e.Cancel = True
Case Windows.Forms.DialogResult.Yes If Evaluations.Save() <> MicroFour.StrataFrame.Data.SaveUndoResult.Success Then e.Cancel =
True End If Case Windows.Forms.DialogResult.No '--Do nothing End SelectThis seems to work but is this a proper way of getting what I need or am I opening myself up for future problems?
Thanks!!