Example #1
0
        private void QueryChecksBasedOnInputParameter(ReportParameter param)
        {
            if (param.ShouldFilterbyDepartment)
            {
                _depts.Add(_deptRepository.GetDepartmentById(param.DepartmentId));
                _banks  = _bankRepository.GetBanksByDepartment(param.DepartmentId);
                _checks = _checkRepository.GetChecksByDateRangeWithDepartmentId(param.Day, param.Day, param.DepartmentId);
            }

            else if (param.ShouldFilterByBank)
            {
                Bank bank = _bankRepository.GetBankById(param.BankId);
                _banks.Add(bank);
                _depts.Add(bank.Department);
                _checks = _checkRepository.GetChecksByDateRangeWithBankId(param.Day, param.Day, param.BankId);
            }
            else
            {
                _depts  = _deptRepository.GetAllDepartments();
                _banks  = _bankRepository.GetAllBanks();
                _checks = _checkRepository.GetChecksByDateRange(param.Day, param.Day);
            }
        }