Пример #1
0
 public async Task <int> GetDataCount()
 {
     using (var materialDao = new MaterialDao())
     {
         return(await materialDao.GetAllAsync().CountAsync());
     }
 }
Пример #2
0
 public async Task <bool> ExistsMaterial(Guid materialId)
 {
     using (IDAL.Master.IMaterialDao materialDao = new MaterialDao())
     {
         return(await materialDao.GetAllAsync().AnyAsync(m => m.Id == materialId));
     }
 }
Пример #3
0
 public async Task <List <Material> > SearchMaterial(string text)
 {
     using (var materialDao = new MaterialDao())
     {
         return(await materialDao.GetAllAsync().Where(m => m.Describe.Contains(text)).ToListAsync());
     }
 }
Пример #4
0
 public async Task <DTO.Master.MaterialDto> GetOneMaterialById(Guid materialId)
 {
     using (IDAL.Master.IMaterialDao materialDao = new MaterialDao())
     {
         return(await materialDao.GetAllAsync()
                .Where(m => m.Id == materialId)
                .Select(m => new DTO.Master.MaterialDto()
         {
             Id = m.Id,
             Code = m.Code,
             LargeCategory = m.LargeCategory,
             SmallCategory = m.SmallCategory,
             Describe = m.Describe,
             Unit = m.Unit,
             Note = m.Note,
             CreateTime = m.CreateTime,
         }).FirstAsync());
     }
 }