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