示例#1
0
        public ListResultDto <ProjectSupplementListDto> GetAllProjectSupplements(GetProjectSupplementListInput input)
        {
            var query = _projectSupplementRepository.GetAll().Where(r => r.ProjectBaseId == input.ProjectId);
            var projectSupplements = query
                                     .OrderBy(input.Sorting)
                                     .ToList();

            return(new ListResultDto <ProjectSupplementListDto>
            {
                Items = projectSupplements.MapTo <List <ProjectSupplementListDto> >()
            });
        }
示例#2
0
        public async Task <bool> ProjectExitSupplements(GetProjectSupplementListInput input)
        {
            var query     = _projectSupplementRepository.GetAll().Where(r => r.ProjectBaseId == input.ProjectId && r.HasSupplement == false);
            var exitcount = await query.CountAsync();

            if (exitcount > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#3
0
        public async Task <PagedResultDto <ProjectSupplementListDto> > GetProjectSupplements(GetProjectSupplementListInput input)
        {
            try
            {
                var query = _projectSupplementRepository.GetAll().Where(r => r.ProjectBaseId == input.ProjectId);
                var count = await query.CountAsync();

                var projectSupplements = await query
                                         .OrderBy(input.Sorting)
                                         .PageBy(input)
                                         .ToListAsync();

                var periodDtos = projectSupplements.MapTo <List <ProjectSupplementListDto> >();
                return(new PagedResultDto <ProjectSupplementListDto>(count, periodDtos));
            }
            catch (Exception ex)
            {
                throw;
            }
        }