private void OnSave() { var returnStatus = false; returnStatus = !IsInEditMode ? CustomerAction.AddCustomerEarMoldOrder(this.DBConnectionString, this.Entity) : CustomerAction.UpdateCustomerEarMoldOrder(this.DBConnectionString, this.Entity); if (returnStatus) { if (RefreshCustomerEarMoldOrder != null) { this.RefreshCustomerEarMoldOrder(); } 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); } }