StrataFrame Forum

Save Changes Dialog

http://forum.strataframe.net/Topic2983.aspx

By Tim Dol - 9/22/2006

How do you force the save changes dialog box to appear?  When the user clicks the print button on my form I want to force the user to save any changes ( If BO IsDirty ).

Thanks.

By Trent L. Taylor - 9/22/2006

You will just need to show your own message box.  That is all the "Save Messages" window is....a MessageForm window.  To do this yourself, it would look something like this:

If MyBo.IsDirty Then
     If MicroFour.StrataFrame.Messaging.MessageForm.ShowMessage(...) = Yes Then
           MyBo.Save()
     End If
End If

By StrataFrame Team - 9/26/2006

If you need to cycle through all of the business objects that belong to the form and are included in the form's save then you can use this:

Dim llDirty As Boolean = False

For Each (loBO As BusinessLayer In Me.GetListOfSaveBOs())
    If loBO.IsDirty Then
        llDirty = True
        Exit For
    End If
Next

If llDirty AndAlso MicroFour.StrataFrame.Messaging.MessageForm.ShowMessage(...) = Yes Then
    MyBo.Save()
End If

The list of business objects that are included in the form's save is determined by the IncludeInForm* settings.