Esempio n. 1
0
        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();
        }
Esempio n. 2
0
        private void DeleteModel(GroupCreditWorthinesViewModel model)
        {
            if (model == null)
            {
                return;
            }
            if (MessageBoxWPF.Show("Вы действительно хотите удалить группу <" + model.Name + "> ?", StringProject.MessageCaption, MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
            {
                return;
            }

            bool flag = repository.DeleteGroupCreditWorthiness(model.GetModel);

            if (!flag)
            {
                MessageBoxWPF.Show(StringProject.ErrorDelRecort, StringProject.ErrorCaption, MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
            AllModel.Remove(model);
        }