Beispiel #1
0
        public async Task <List <ScheduleUpdateDto> > GetDetailSchedule(int scheduleID)
        {
            var nameProcess = _repoScheduleUpdate.FindAll().FirstOrDefault(x => x.ID == scheduleID).Treatment;
            var idProcess   = _repoProcess.FindAll().FirstOrDefault(x => x.Name == nameProcess).ID;
            var lists       = await _repoScheduleUpdate.FindAll()
                              .Where(x => x.ID == scheduleID)
                              .ProjectTo <ScheduleUpdateDto>(_configMapper)
                              .OrderByDescending(x => x.ID).Select(x => new ScheduleUpdateDto
            {
                ID             = x.ID,
                ModelName      = x.ModelName,
                ModelNo        = x.ModelNo,
                Part           = x.Part,
                ArticleNo      = x.ArticleNo,
                Treatment      = x.Treatment,
                Process        = x.Process,
                ApprovalStatus = x.ApprovalStatus,
                FinishedStatus = x.FinishedStatus,
                CreatedDate    = x.CreatedDate,
                UpdateTime     = x.UpdateTime,
                CreatedBy      = x.CreatedBy,
                ProductionDate = x.ProductionDate,
                EstablishDate  = x.EstablishDate,
                Parts          = _repoPart.FindAll().Where(y => y.ScheduleID == scheduleID).ToList(),
                Supplier       = _repoSup.FindAll().Where(y => y.ProcessID == idProcess && y.isShow == true).ToList(),
                TreatmentWay   = _repoTreatmentWay.FindAll().Where(y => y.processID == idProcess).ToList()
            }).ToListAsync();

            return(lists);
        }
 public async Task <List <TreatmentWayDto> > GetAllAsync()
 {
     return(await _repoTreatmentWay.FindAll().Select(x => new TreatmentWayDto {
         ID = x.ID,
         Name = x.Name,
         process = _repoProcess.FindAll().FirstOrDefault(y => y.ID == x.processID).Name
     }).OrderByDescending(x => x.ID).ToListAsync());
 }
Beispiel #3
0
        public async Task <object> GetGluesByScheduleID(int id)
        {
            var list = await _repoGlues.FindAll().Where(x => x.ScheduleID == id)
                       .Select(x => new GluesDto
            {
                ID             = x.ID,
                Name           = x.Name,
                PartID         = x.PartID,
                TreatmentWayID = x.TreatmentWayID,
                CreatedDate    = x.CreatedDate,
                Part           = _repoPart.FindAll().FirstOrDefault(y => y.ID == x.PartID).Name,
                TreatmentWay   = _repoTreatmentWay.FindAll().FirstOrDefault(y => y.ID == x.TreatmentWayID).Name
            }).ToListAsync();

            return(list);
        }