public void RemoveData() { Orders.ToList().ForEach(RemoveOrder); Payments.ToList().ForEach(RemovePayment); ChangePayments.ToList().ForEach(RemoveChangePayment); Calculations.ToList().ForEach(RemoveCalculation); }
public void AddChangePayment(ChangePaymentType changePaymentType, Account account, decimal amount, decimal exchangeRate, int userId) { var transaction = TransactionDocument.AddNewTransaction(changePaymentType.AccountTransactionType, GetTicketAccounts(account), amount, exchangeRate); var payment = new ChangePayment { AccountTransaction = transaction, Amount = amount, Name = account.Name, ChangePaymentTypeId = changePaymentType.Id }; ChangePayments.Add(payment); }
public decimal GetChangeAmount() { return(ChangePayments.Sum(x => x.Amount)); }
public void RemoveChangePayment(ChangePayment py) { ChangePayments.Remove(py); TransactionDocument.AccountTransactions.Where(x => x.Id == py.AccountTransaction.Id).ToList().ForEach(x => TransactionDocument.AccountTransactions.Remove(x)); }