Пример #1
0
 public async Task <int> GetDataCount()
 {
     using (var inStorageTaskDao = new InStorageTaskDao())
     {
         return(await inStorageTaskDao.GetAllAsync().CountAsync());
     }
 }
Пример #2
0
 public async Task RemoveInStorage(Guid id)
 {
     using (var inStorageTaskDao = new InStorageTaskDao())
     {
         await inStorageTaskDao.RemoveAsync(id);
     }
 }
Пример #3
0
 public async Task CreateInStorageTask(string Organization, string SysBatch, string State, Guid InStorageId, Guid MaterialId, int Number, DateTime PlanTime, Guid ProviderId, string Note)
 {
     using (var inStorageTaskDao = new InStorageTaskDao())
     {
         await inStorageTaskDao.CreateAsync(new InStorageTask()
         {
             Organization = Organization,
             SysBatch     = SysBatch,
             State        = State,
             InStorageId  = InStorageId,
             MaterialId   = MaterialId,
             Number       = Number,
             PlanTime     = PlanTime,
             ProviderId   = ProviderId,
             Note         = Note,
         });
     }
 }
Пример #4
0
 public List <InStorageTaskDto> getAllInStorage(int pageSize, int pageIndex, bool asc)
 {
     using (var inStorageTaskDao = new InStorageTaskDao())
     {
         return(inStorageTaskDao.GetAllByPageOrderAsync(pageIndex - 1, pageSize, asc).Select(m => new InStorageTaskDto()
         {
             Id = m.Id,
             Organization = m.Organization,
             SysBatch = m.SysBatch,
             State = m.State,
             InStorageName = m.InStorage.Name,
             Code = m.Material.Code,
             Describe = m.Material.Describe,
             Unit = m.Material.Unit,
             PlanNumber = m.Number,
             PlanTime = m.PlanTime,
             ProviderName = m.Provider.Name,
             Note = m.Note,
             CreateTime = m.CreateTime
         }).ToList());
     }
 }
Пример #5
0
 public async Task <InStorageTaskDto> GetOneMaterialById(Guid inStorageTaskId)
 {
     using (InStorageTaskDao inStorageTaskDao = new InStorageTaskDao())
     {
         return(await inStorageTaskDao.GetAllAsync()
                .Where(m => m.Id == inStorageTaskId)
                .Select(m => new InStorageTaskDto()
         {
             Id = m.Id,
             Organization = m.Organization,
             SysBatch = m.SysBatch,
             State = m.State,
             InStorageName = m.InStorage.Name,
             Code = m.Material.Code,
             Describe = m.Material.Describe,
             Unit = m.Material.Unit,
             PlanNumber = m.Number,
             PlanTime = m.PlanTime,
             ProviderName = m.Provider.Name,
             Note = m.Note,
             CreateTime = m.CreateTime
         }).FirstAsync());
     }
 }