public List <ExpBankVoucher> GetTransactionInfoForSearch() { using (_context) { var Data = (from t in _context.EXP_BankVoucher.AsEnumerable() join b in _context.Sys_Bank on t.BankID equals b.BankID into Banks from b in Banks.DefaultIfEmpty() join br in _context.Sys_Branch on t.BranchID equals br.BranchID into Branches from br in Branches.DefaultIfEmpty() join ci in _context.EXP_CI on(t.CIID == null?null:t.CIID) equals ci.CIID into CIs from ci in CIs.DefaultIfEmpty() orderby t.BVID descending select new ExpBankVoucher { BVID = t.BVID, RefBVNo = t.RefBVNo, BVDate = (Convert.ToDateTime(t.BVDate)).ToString("dd'/'MM'/'yyyy"), BVType = (t.BVType == "DR"? "Debit": "Credit"), BankID = t.BankID, BankName = b == null?null:b.BankName, BranchID = t.BranchID, BranchName = br == null ? null : br.BranchName, ACNo = t.ACNo, ACName = t.ACName, Remarks = t.Remarks, RecordStatus = DalCommon.ReturnRecordStatus(t.RecordStatus) }).ToList(); return(Data); } }
public List <EXPBankVoucherDtl> GetVouchertemList(long BVID) { using (var context = new BLC_DEVEntities()) { var Data = (from vd in context.EXP_BankVoucherDtl where vd.BVID == BVID join c in context.Sys_Currency on(vd.Currency == null ? null : vd.Currency) equals c.CurrencyID into Currencies from c in Currencies.DefaultIfEmpty() join ec in context.Sys_Currency on(vd.ExchangeCurrency == null ? null : vd.ExchangeCurrency) equals ec.CurrencyID into ExchangeCurrencies from ec in ExchangeCurrencies.DefaultIfEmpty() join th in context.Sys_TransHead on(vd.TransHead == null ? null : vd.TransHead) equals th.HeadID into TransHeads from th in TransHeads.DefaultIfEmpty() join ci in context.EXP_CI on(vd.CIID == null ? null : vd.CIID) equals ci.CIID into CIs from ci in CIs.DefaultIfEmpty() select new EXPBankVoucherDtl { BVDTLID = vd.BVDTLID, TransSL = vd.TransSL, Narration = vd.Narration, HeadID = vd.TransHead, HeadName = (th == null ? null : th.HeadName), BVDRAmt = vd.BVDRAmt, BVCRAmt = vd.BVCRAmt, CurrencyName = (c == null ? null : c.CurrencyName), ExchangeCurrencyName = (ec == null ? null : ec.CurrencyName), ExchangeRate = vd.ExchangeRate, ExchangeAmount = vd.ExchangeAmount, CIID = vd.CIID, CIRefNo = ci == null ? "" : ci.CIRefNo }).ToList(); return(Data); } }