private void UpdateModel(GroupCreditWorthinesViewModel model) { if (model == null) { return; } AddGroupCreditWorthinesView view = new AddGroupCreditWorthinesView(false, model.GetModel, repository) { ShowInTaskbar = false }; view.ShowDialog(); if (view.DialogResult != true) { return; } bool flag = repository.UpdateGroupCreditWorthiness(model.GetModel); if (!flag) { MessageBoxWPF.Show(StringProject.ErrorUpdRecort, StringProject.ErrorCaption, MessageBoxButton.OK, MessageBoxImage.Error); return; } model.RefreshModel(); }
private void AddModel() { GroupCreditWorthiness model = new GroupCreditWorthiness(); AddGroupCreditWorthinesView view = new AddGroupCreditWorthinesView(true, model, repository) { ShowInTaskbar = false }; view.ShowDialog(); if (view.DialogResult != true) { return; } model.Id = repository.AddGroupCreditWorthiness(model); if (model.Id == 0) { MessageBoxWPF.Show(StringProject.ErrorAddRecort, StringProject.ErrorCaption, MessageBoxButton.OK, MessageBoxImage.Error); return; } AllModel.Add(new GroupCreditWorthinesViewModel(model)); }