Exemplo n.º 1
0
 private void ExecuteClosing(object parameter)
 {
     if (canexecutesave)
     {
         IMessageBoxService      msg    = new MessageBoxService();
         GenericMessageBoxResult result = msg.ShowMessage("There are unsaved changes. Do you want to save these?", "Unsaved Changes", GenericMessageBoxButton.YesNo, GenericMessageBoxIcon.Question);
         msg = null;
         if (result.Equals(GenericMessageBoxResult.Yes))
         {
             SaveCustomer();
         }
     }
     //refresh Customers list
     StaticCollections.Customers = DatabaseQueries.GetCustomers();
 }
Exemplo n.º 2
0
        private bool CanCloseWindow(object obj)
        {
            if (IsDirtyData)
            {
                IMessageBoxService      msg    = new MessageBoxService();
                GenericMessageBoxResult result = msg.ShowMessage("There are unsaved changes. Do you want to save these?", "Unsaved Changes", GenericMessageBoxButton.YesNo, GenericMessageBoxIcon.Question);
                msg = null;
                if (result.Equals(GenericMessageBoxResult.Yes))
                {
                    ExecuteUpdateActivities();
                }

                return(true);
            }
            else
            {
                return(true);
            }
        }