Ejemplo n.º 1
0
        private IMCCommand InitDuplicateAndApplyNowCommand()
        {
            return(new DataGridSelectedItemCommand <ITransaction>(GridTransactions,
                                                                  (item) =>
            {
                // when transaction is record
                if (item is RecordModel)
                {
                    AddNew(_recordService.Duplicate(item as RecordModel));
                }

                // when transaction is money transfer
                if (item is MoneyTransferModel)
                {
                    AddNew(_moneyTransferService.Duplicate(item as MoneyTransferModel));
                }
            }, item => !item.IsPlanned));
        }