private ReportDataSource GetJournalDet(DateTime?dateFrom, DateTime?dateTo, string costCenterId)
        {
            IList <TJournalDet> dets;

            if (!string.IsNullOrEmpty(costCenterId))
            {
                MCostCenter costCenter = _mCostCenterRepository.Get(costCenterId);
                dets = _tJournalDetRepository.GetForReport(dateFrom, dateTo, costCenter);
            }
            else
            {
                dets = _tJournalDetRepository.GetForReport(dateFrom, dateTo, null);
            }

            var list = from det in dets
                       select new
            {
                det.JournalDetAmmount,
                det.JournalDetStatus,
                det.JournalDetDesc,
                det.JournalDetEvidenceNo,
                det.JournalId.JournalVoucherNo,
                CostCenterId = det.JournalId.CostCenterId.Id,
                det.JournalId.CostCenterId.CostCenterName,
                det.JournalId.JournalDate,
                AccountId = det.AccountId.Id,
                det.AccountId.AccountName
            }
            ;

            ReportDataSource reportDataSource = new ReportDataSource("JournalDetViewModel", list.ToList());

            return(reportDataSource);
        }
        private ReportDataSource GetJournalDet(DateTime?dateFrom, DateTime?dateTo, string costCenterId, string accountId)
        {
            IList <TJournalDet> dets = _tJournalDetRepository.GetForReport(dateFrom, dateTo, costCenterId, accountId);

            var list = from det in dets
                       select new
            {
                det.JournalDetAmmount,
                det.JournalDetStatus,
                det.JournalDetDesc,
                det.JournalDetEvidenceNo,
                det.JournalId.JournalVoucherNo,
                CostCenterId   = det.JournalId.CostCenterId != null ? det.JournalId.CostCenterId.Id : null,
                CostCenterName = det.JournalId.CostCenterId != null ? det.JournalId.CostCenterId.CostCenterName : null,
                det.JournalId.JournalDate,
                AccountId   = det.AccountId != null ? det.AccountId.Id : null,
                AccountName = det.AccountId != null ? det.AccountId.AccountName : null,
                JournalPic  = det.JournalId != null ? det.JournalId.JournalPic : null,
                JournalPic2 = det.JournalId != null ? det.JournalId.JournalPic2 : null
            }
            ;

            ReportDataSource reportDataSource = new ReportDataSource("JournalDetViewModel", list.ToList());

            return(reportDataSource);
        }