public void DeleteVerification(int no) { using (var core = new StandardBusinessLayer(this)) { core.Connect(); Verification verification = Verifications.FirstOrDefault(v => v.No == no); if (verification != null) { core.DeleteVerification(no); Verifications.Remove(verification); } } }
public void DeleteCashBookTransaction(int no) { using (var core = new StandardBusinessLayer(this)) { core.Connect(); var transaction = CashBookTransactions.FirstOrDefault(t => t.No == no); if (transaction != null) { Verification verification = Verifications.FirstOrDefault(v => v.No == transaction.VerificationNo); core.DeleteCashBookTransaction(no); CashBookTransactions.Remove(transaction); FillVerification(verification); } } }
public void DeleteCashBookTransactionsByVerificationNo(int verificationNo) { using (var core = new StandardBusinessLayer(this)) { core.Connect(); var transactions = CashBookTransactions.Where(t => t.VerificationNo == verificationNo).ToList(); if (transactions.Count() > 0) { var verification = Verifications.FirstOrDefault(v => v.No == transactions[0].VerificationNo); core.DeleteCashBookTransactionsByVerificationNo(verificationNo); foreach (var transaction in transactions) { CashBookTransactions.Remove(transaction); } FillVerification(verification); } } }
public Verification GetVerification(int no) { return(Verifications.FirstOrDefault(v => v.No == no)); }