public void Save() { dynamic res; if (Model.Id > 0) { res = repository.Edit(Model); } else { res = repository.AddNew(Model); } if (res.Item1) { if (MessageBox.Show("Successful, do you want to add an other host?", "Info" , MessageBoxButton.YesNo, MessageBoxImage.Information) == MessageBoxResult.Yes) { Model = new Host(); } else { RequestClose(this, EventArgs.Empty); } } else { if (MessageBox.Show(res.Item2 + ", do you want to try again?", "Error" , MessageBoxButton.YesNo, MessageBoxImage.Error) == MessageBoxResult.Yes) { } else { RequestClose(this, EventArgs.Empty); } } }