public AccountTransaction PostAccountTransaction(AccountTransaction accountTransaction) { var item = AccountTransactions.FirstOrDefault(c => c.AccountTransactionId == accountTransaction.AccountTransactionId); if (item != null) { item = accountTransaction; return(item); } else { accountTransaction.AccountTransactionId = GenerateAccontTransactionId(); AccountTransactions.Add(accountTransaction); return(accountTransaction); } }
public StockTransaction GetStockTransaction(int stockTransactionId) { if (StockTransactions.Any(c => c.StockTransactionId == stockTransactionId)) { var result = StockTransactions.First(c => c.StockTransactionId == stockTransactionId); if (result.AccountTransaction == null) { result.AccountTransaction = AccountTransactions.FirstOrDefault(c => c.AccountTransactionId == result.AccountTransactionId); } if (result.Stock == null) { result.Stock = GetStock(result.StockCode); } return(result); } return(null); }
public void DeleteAccountTransaction(int no) { using (var core = new StandardBusinessLayer(this)) { core.Connect(); AccountTransaction transaction = AccountTransactions.FirstOrDefault(t => t.No == no); if (transaction != null) { Verification verification = Verifications.FirstOrDefault(v => v.No == transaction.VerificationNo); core.DeleteAccountTransaction(no); AccountTransactions.Remove(transaction); FillVerification(verification); } } }
public AccountTransaction GetAccountTransaction(int no) { return(AccountTransactions.FirstOrDefault(t => t.No == no)); }