示例#1
0
        private async Task AmountChanged(ExpenseItemWrapper itemWrapper)
        {
            var currency = Currencies.FirstOrDefault(c => c.Id == itemWrapper.Item.CurrencyId);

            if (currency != null)
            {
                itemWrapper.Item.UsdAmount = currency.Rate * itemWrapper.Item.Amount;
                double totalAmountString = ConvertToTwoDecimal.RoundUp(ItemList.Select(i => i.UsdAmount).Sum());
                await OnTotalAmountChange.InvokeAsync(totalAmountString);
            }
        }
示例#2
0
        private void AmountChanged(CreateExpenseItemFrontCommand item)
        {
            var currency = Currencies.FirstOrDefault(c => c.Id == item.CurrencyId);

            if (currency != null)
            {
                item.UsdAmount = currency.Rate * item.Amount;
                double totalAmountString = ConvertToTwoDecimal.RoundUp(ItemList.Select(i => i.UsdAmount).Sum());
                OnTotalAmountChange.InvokeAsync(totalAmountString);
            }
        }