private void CommitButton_Click(object sender, RoutedEventArgs e) { bool confirm = MessageFunctions.ConfirmOKCancel("Are you sure you wish to save your amendments?", "Save changes?"); if (!confirm) { return; } bool success = (editMode == ByClient) ? ClientFunctions.SaveClientProductChanges(Globals.SelectedClient.ID) : ClientFunctions.SaveProductClientChanges(selectedProductID); if (success) { MessageFunctions.SuccessAlert("Your changes have been saved successfully. You can make further changes, go back to the previous screen, or close the current page.", "Changes Saved"); CommitButton.IsEnabled = false; } }