Exemplo n.º 1
0
 public async Task RemoveInStorage(Guid id)
 {
     using (var inStorageDao = new InStorageDao())
     {
         await inStorageDao.RemoveAsync(id);
     }
 }
Exemplo n.º 2
0
 public async Task <bool> ExistsInStorage(Guid inStorageId)
 {
     using (IDAL.Master.IInStorageDao inStorageDao = new InStorageDao())
     {
         return(await inStorageDao.GetAllAsync().AnyAsync(m => m.Id == inStorageId));
     }
 }
Exemplo n.º 3
0
 public async Task <int> GetDataCount()
 {
     using (var inStorageDao = new InStorageDao())
     {
         return(await inStorageDao.GetAllAsync().CountAsync());
     }
 }
Exemplo n.º 4
0
 public async Task <List <InStorageDto> > GetAllInStorage()
 {
     using (var inStorageDao = new InStorageDao())
     {
         return(await inStorageDao.GetAllOrderAsync(false)
                .Select(m => new InStorageDto()
         {
             Id = m.Id,
             Name = m.Name,
         }).ToListAsync());
     }
 }
Exemplo n.º 5
0
        public async Task EditInStorage(Guid inStorageId, string code, string name, string category, string describe)
        {
            using (var inStorageDao = new InStorageDao())
            {
                var inStorage = await inStorageDao.GetOneByIdAsync(inStorageId);

                inStorage.Code     = code;
                inStorage.Name     = name;
                inStorage.Category = category;
                inStorage.Describe = describe;
                await inStorageDao.EditAsync(inStorage);
            }
        }
Exemplo n.º 6
0
 public async Task CreateInStorage(string code, string name, string category, string describe)
 {
     using (var inStorageDao = new InStorageDao())
     {
         await inStorageDao.CreateAsync(new InStorage()
         {
             Code     = code,
             Name     = name,
             Category = category,
             Describe = describe
         });
     }
 }
Exemplo n.º 7
0
 public async Task <List <InStorageDto> > GetAllInStorage(int pageIndex, int pageSize, bool asc = true)
 {
     using (var inStorageDao = new InStorageDao())
     {
         return(await inStorageDao.GetAllByPageOrderAsync(pageIndex - 1, pageSize, asc).Select(m => new DTO.Master.InStorageDto()
         {
             Id = m.Id,
             Code = m.Code,
             Name = m.Name,
             Category = m.Category,
             Describe = m.Describe,
             CreateTime = m.CreateTime,
         }).ToListAsync());
     }
 }
Exemplo n.º 8
0
 public async Task <DTO.Master.InStorageDto> GetOneInStorageById(Guid inStorageId)
 {
     using (IDAL.Master.IInStorageDao inStorageDao = new InStorageDao())
     {
         return(await inStorageDao.GetAllAsync()
                .Where(m => m.Id == inStorageId)
                .Select(m => new DTO.Master.InStorageDto()
         {
             Code = m.Code,
             Name = m.Name,
             Category = m.Category,
             Describe = m.Describe,
             CreateTime = m.CreateTime,
         }).FirstAsync());
     }
 }