private void UpdateBalances()
 {
     Balances.Clear();
     if (SelectedTicket == null)
     {
         return;
     }
     foreach (var ticketEntity in SelectedTicket.TicketEntities)
     {
         if (ticketEntity.AccountId > 0)
         {
             var entityType = _cacheService.GetEntityTypeById(ticketEntity.EntityTypeId);
             if (_applicationState.GetPaymentScreenPaymentTypes().Any(x => x.AccountTransactionType.TargetAccountTypeId == entityType.AccountTypeId))
             {
                 var balance = _accountDao.GetAccountBalance(ticketEntity.AccountId);
                 balance +=
                     SelectedTicket.Payments.Where(
                         x =>
                         x.Id == 0 &&
                         x.AccountTransaction.AccountTransactionValues.Any(
                             y => y.AccountId == ticketEntity.AccountId)).Sum(x => x.Amount);
                 Balances.Add(ticketEntity.AccountId, balance);
             }
         }
     }
 }
예제 #2
0
 private void UpdateBalances()
 {
     Balances.Clear();
     foreach (var ticketEntity in SelectedTicket.TicketEntities)
     {
         if (ticketEntity.AccountId > 0)
         {
             var entityType = _cacheService.GetEntityTypeById(ticketEntity.EntityTypeId);
             if (_applicationState.GetPaymentScreenPaymentTypes().Any(x => x.AccountTransactionType.TargetAccountTypeId == entityType.AccountTypeId))
             {
                 var balance = _accountService.GetAccountBalance(ticketEntity.AccountId);
                 Balances.Add(ticketEntity.AccountId, balance);
             }
         }
     }
 }
 public void Update(ForeignCurrency foreignCurrency)
 {
     PaymentButtonGroup.Update(_applicationState.GetPaymentScreenPaymentTypes(), foreignCurrency);
     RaisePropertyChanged(nameof(PaymentButtonGroup));
 }