Beispiel #1
0
        public List <TkmTransaction> FetchAllWithPagination(ref BaseSearchQueryModel searchQuery)
        {
            var result = _transactionRepository.Query().Where(b => b.IsActive);

            searchQuery.TotalData = BaseSearchQueryExpression <TkmTransaction> .DefaultQueryExpression(ref result, searchQuery);

            return(result.OrderByDescending(e => e.TransactionDate).ThenByDescending(e => e.LastUpdatedDate).ToList());
        }
        public List <MasterInstitution> FetchAllWithPagination(ref BaseSearchQueryModel searchQuery)
        {
            var result = _institutionRepository.Query().Where(i => i.IsActive);

            searchQuery.TotalData = BaseSearchQueryExpression <MasterInstitution> .DefaultQueryExpression(ref result, searchQuery);

            return(result.ToList());
        }
Beispiel #3
0
        public List <MasterUom> FetchAllWithPagination(ref BaseSearchQueryModel searchQuery)
        {
            var result = _uomRepository.Query().Where(u => u.IsActive);

            searchQuery.TotalData = BaseSearchQueryExpression <MasterUom> .DefaultQueryExpression(ref result, searchQuery);

            return(result.ToList());
        }
Beispiel #4
0
        public List <MasterRole> FetchAllWithPagination(ref BaseSearchQueryModel searchQuery)
        {
            var institutionId = _securityService.GetCurrentInstitutionId();
            var result        = _roleRepository.Query().Where(r => r.IsActive && r.InstitutionId == institutionId);

            searchQuery.TotalData = BaseSearchQueryExpression <MasterRole> .DefaultQueryExpression(ref result, searchQuery);

            return(result.ToList());
        }
Beispiel #5
0
        public List <MasterBin> FetchAllWithPagination(ref BaseSearchQueryModel searchQuery)
        {
            var institutionId = _securityService.GetCurrentInstitutionId();
            var result        = _binRepository.Query().Where(b => b.IsActive && b.IsActive && b.InstitutionId == institutionId).Include(b => b.ReaderModule);

            searchQuery.TotalData = BaseSearchQueryExpression <MasterBin> .DefaultQueryExpression(ref result, searchQuery);

            return(result.ToList());
        }
Beispiel #6
0
        public List <MasterItem> FetchAllWithPagination(ref BaseSearchQueryModel searchQuery)
        {
            var institutionId = _securityService.GetCurrentInstitutionId();
            var result        =
                _itemRepository.Query()
                .Include(i => i.Uom)
                .Include(i => i.Brand)
                .Where(i => i.IsActive && i.InstitutionId == institutionId);

            searchQuery.TotalData = BaseSearchQueryExpression <MasterItem> .DefaultQueryExpression(ref result, searchQuery);

            return(result.ToList());
        }
        public List <MasterUserInstitutionRole> FetchAllWithPagination(ref BaseSearchQueryModel searchQuery, long userId)
        {
            var institutionId = _securityService.GetCurrentInstitutionId();
            var user          = _userService.FetchOne(userId);

            if (user == null)
            {
                return(null);
            }

            var userInstitution = user.Institutions.FirstOrDefault(u => u.InstitutionId == institutionId);

            var result =
                _userInstitutionRoleRepository.Query()
                .Where(
                    u =>
                    u.IsActive && u.UserInstitutionId == userInstitution.UserInstitutionId &&
                    u.InstitutionId == institutionId);

            searchQuery.TotalData = BaseSearchQueryExpression <MasterUserInstitutionRole> .DefaultQueryExpression(ref result, searchQuery);

            return(result.ToList());
        }