private void DeleteModel(GroupCharacterViewModel model) { if (model == null) return; if (MessageBoxWPF.Show("Вы действительно хотите удалить параметр ?", StringProject.MessageCaption, MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No) return; bool flag = repository.DeleteGroupCharacter(model.GetModel); if (!flag) { MessageBoxWPF.Show(StringProject.ErrorDelRecort, StringProject.ErrorCaption, MessageBoxButton.OK, MessageBoxImage.Error); return; } AllModel.Remove(model); }
private void UpdateModel(GroupCharacterViewModel model) { if (model == null) return; AddGroupCharacterView view = new AddGroupCharacterView(false, model.GetModel, repository) { ShowInTaskbar = false }; view.ShowDialog(); if (view.DialogResult != true) return; bool flag = repository.UpdateGroupCharacter(model.GetModel); if (!flag) { MessageBoxWPF.Show(StringProject.ErrorUpdRecort, StringProject.ErrorCaption, MessageBoxButton.OK, MessageBoxImage.Error); return; } model.RefreshModel(); }