Example #1
0
        public async Task <List <MachineViewModel> > GetListMachineType(string factory, string building)
        {
            var machines = await _repoMachineInfomation.GetAll()
                           .Where(x => x.factory_id.Trim() == factory.Trim() &&
                                  building == "ALL"? 1 == 1 : x.building_id.Trim() == building.Trim())
                           .ToListAsync();

            var machineType = await _repoMachineType.GetAll().ToListAsync();

            var data = (from a in machines
                        join b in machineType
                        on a.machine_type equals b.id
                        select new MachineViewModel()
            {
                id = b.id,
                machine_type_name = b.machine_type_name
            }).GroupBy(x => x.id).Select(x => x.First()).ToList();

            return(data);
        }
Example #2
0
 public IEnumerable <MachineType> GetMachineType()
 {
     return(_machineTypeRepository.GetAll());
 }
Example #3
0
        public async Task <IEnumerable <OutMachineTypeDTO> > GetMachineTypes()
        {
            var machineTypes = await _machineTypeRepository.GetAll();

            return(MachineTypeMapping.MachineTypeToOutDto(machineTypes));
        }
Example #4
0
 public async Task <ActionResult <IEnumerable <MachineType> > > GetMachineTypes()
 {
     return(await _machineTypeRepository.GetAll());
 }