public IQueryable <DocumentResolutionVM> Select(DocumentResolutionFilterVM filter)
        {
            filter.NormalizeValues();

            return(repo.AllReadonly <DocumentResolution>()
                   .Include(x => x.JudgeDecisionLawunit)
                   .Include(x => x.ResolutionType)
                   .Include(x => x.ResolutionState)
                   .Include(x => x.Court)
                   .Include(x => x.Document)
                   .ThenInclude(x => x.DocumentType)
                   .Where(x => x.CourtId == userContext.CourtId)
                   .Where(x => x.RegDate != null)
                   .Where(x => x.RegDate >= (filter.DateFrom.ForceStartDate() ?? x.RegDate) && x.RegDate <= (filter.DateTo.ForceEndDate() ?? x.RegDate))
                   .Where(x => x.RegNumber == (filter.ResolutionNumber ?? x.RegNumber))
                   .Where(x => x.JudgeDecisionLawunitId == (filter.JudgeId ?? x.JudgeDecisionLawunitId))
                   .Where(x => x.Document.DocumentNumber == (filter.DocumentNumber ?? x.Document.DocumentNumber))
                   .Where(x => x.Document.DocumentDate.Year == (filter.DocumentYear ?? x.Document.DocumentDate.Year))
                   .ProjectTo <DocumentResolutionVM>(DocumentResolutionVM.GetMapping())
                   .AsQueryable());
        }
Esempio n. 2
0
        public IActionResult ListData(IDataTablesRequest request, DocumentResolutionFilterVM filter)
        {
            var data = drService.Select(filter);

            return(request.GetResponse(data));
        }