public void AddOrEdit(DataGridRowEditEndingEventArgs accountItem)
        {
            var account = (Dictionary)accountItem.Row.DataContext;

            if (account.Id == 0 && account.Name != null)
            {
                account.EntityType = (int)EntityTypes.Accounts;
                accounts.AddDictItem(account);
            }
            else
            {
                accounts.UpdateDictItem(account);
            }

            MessageArg message = new MessageArg()
            {
                Sender  = MessageSenders.AccountsPage,
                Message = account
            };

            eventAggregator.PublishOnUIThread(message); // сообщение для форм ввода
        }
Example #2
0
        public void AddOrEdit(DataGridRowEditEndingEventArgs marketItem)
        {
            var market = (Dictionary)marketItem.Row.DataContext;

            if (market.Name != null)
            {
                if (market.Id == 0)
                {
                    market.EntityType = (int)EntityTypes.Markets;
                    markets.AddDictItem(market);
                }
                else
                {
                    markets.UpdateDictItem(market);
                }
                MessageArg message = new MessageArg
                {
                    Sender  = MessageSenders.MarketsPage,
                    Message = market
                };

                eventAggregator.PublishOnUIThread(message); // сообщение для формы
            }
        }