private void OnSave() { var returnStatus = false; returnStatus = !IsInEditMode ? CustomerAction.AddCustomerHearingAidOrder(this.DBConnectionString, this.Entity) : CustomerAction.UpdateCustomerHearingAidOrder(this.DBConnectionString, this.Entity); if (returnStatus) { if (RefreshCustomerHearingAIDOrder != null) { this.RefreshCustomerHearingAIDOrder(); } var messageDailog = new MessageDailog() { Caption = MessageResources.DataSavedSuccessfully, DialogButton = DialogButton.Ok, Title = TitleResources.Information }; MessengerInstance.Send(messageDailog); if (this.CloseWindow != null) { this.CloseWindow(); } } else { var messageDailog = new MessageDailog() { Caption = MessageResources.DataSavedFailed, DialogButton = DialogButton.Ok, Title = TitleResources.Error }; MessengerInstance.Send(messageDailog); } }