public void ShowTransactionEditor(TransactionItem item) { TransactionEditorViewModel vm = new TransactionEditorViewModel(item.tr); if (service.ShowTransactionEditor(vm) == true) { // Properties were edited, read them. DateTime date = vm.Date; decimal amount = vm.Amount; string info = vm.Info; CategoryNode catNode = vm.Category; // Update transaction. Core.Instance.UpdateTransaction(item.tr, date, amount, info, catNode.category); } }
public void ShowTransactionEditor() { TransactionEditorViewModel vm = new TransactionEditorViewModel(); if (service.ShowTransactionEditor(vm) == true) { // Properties were edited, read them. DateTime date = vm.Date; decimal amount = vm.Amount; string info = vm.Info; CategoryNode catNode = vm.Category; // Create new transaction. Transaction newTr; if (Core.Instance.AddTransaction(account, date, amount, info, catNode.category, out newTr)) { Transactions.Add(new TransactionItem(newTr)); } } }