Пример #1
0
        private async Task <bool> CheckUpdateData(BPFCEstablishDtoForImportExcel bPFCEstablishDto)
        {
            var model = await(from m in _repoModelName.FindAll()
                              join n in _repoModelNo.FindAll() on m.ID equals n.ModelNameID
                              join a in _repoArticleNo.FindAll() on n.ID equals a.ModelNoID
                              join ap in _repoArtProcess.FindAll().Include(x => x.Process) on a.ID equals ap.ArticleNoID
                              select new BPFCEstablishDtoForImportExcel
            {
                ModelName   = m.Name,
                ModelNo     = n.Name,
                ArticleNo   = a.Name,
                Process     = ap.Process.Name,
                CreatedBy   = bPFCEstablishDto.CreatedBy,
                CreatedDate = bPFCEstablishDto.CreatedDate
            }).ToListAsync();

            return(model.Any(x => x.ModelName == bPFCEstablishDto.ModelName &&
                             x.ModelNo == bPFCEstablishDto.ModelNo &&
                             x.ArticleNo == bPFCEstablishDto.ArticleNo &&
                             x.Process == bPFCEstablishDto.Process));
        }
Пример #2
0
        //Lấy danh sách Brand và phân trang
        public async Task <PagedList <ModelNameDto> > GetWithPaginations(PaginationParams param)
        {
            var lists = _repoModelName.FindAll().ProjectTo <ModelNameDto>(_configMapper).OrderByDescending(x => x.ID);

            return(await PagedList <ModelNameDto> .CreateAsync(lists, param.PageNumber, param.PageSize));
        }