public void SetLedgerTxn(LedgerTxn txn) { if (txn == null) { throw new ArgumentNullException(nameof(txn)); } var existingTx = LedgerTxns.FirstOrDefault(a => a.LedgerTxnNum == txn.LedgerTxnNum); if (existingTx != null) { LedgerTxns.Remove(existingTx); } LedgerTxns.Add(txn); }
public LedgerTxn(LedgerTxn ledgerTxn) { if (ledgerTxn == null) { throw new ArgumentNullException(nameof(ledgerTxn)); } LedgerTxnId = ledgerTxn.LedgerTxnId; LedgerId = ledgerTxn.LedgerId; Comment = ledgerTxn.Comment; AccountFrom = ledgerTxn.AccountFrom; AccountTo = ledgerTxn.AccountTo; EntryDate = ledgerTxn.EntryDate; PostDate = ledgerTxn.PostDate; Credit = ledgerTxn.Credit; Debit = ledgerTxn.Debit; LedgerTxnNum = ledgerTxn.LedgerTxnNum; }