public void DeleteStockTransaction(int stockTransactionId) { var stockTransaction = GetStockTransaction(stockTransactionId); if (AccountTransactions.Any(c => c.AccountTransactionId == stockTransaction.AccountTransactionId)) { AccountTransactions.Remove(AccountTransactions.First(c => c.AccountTransactionId == stockTransaction.AccountTransactionId)); } StockTransactions.Remove(stockTransaction); Save(); }
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 void DeleteAccountTransactionsByVerificationNo(int verificationNo) { using (var core = new StandardBusinessLayer(this)) { core.Connect(); var transactions = AccountTransactions.Where(t => t.VerificationNo == verificationNo).ToList(); if (transactions.Count() > 0) { var verification = Verifications.FirstOrDefault(v => v.No == transactions[0].VerificationNo); core.DeleteAccountTransactionsByVerificationNo(verificationNo); foreach (var transaction in transactions) { AccountTransactions.Remove(transaction); } FillVerification(verification); } } }